mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-29 07:35:44 +01:00
fixed tests
This commit is contained in:
@@ -249,10 +249,14 @@ class Project:
|
||||
if file_path != '':
|
||||
paths.insert(0, file_path)
|
||||
|
||||
if not re.match(r'^/|~|\w+:/', file_path):
|
||||
paths.insert(0, self.root_path)
|
||||
if file_path == '/':
|
||||
absolute_path = file_path + file_name
|
||||
else:
|
||||
if not re.match(r'^/|~|\w+:', file_path):
|
||||
paths.insert(0, self.root_path)
|
||||
absolute_path = '/'.join(paths)
|
||||
|
||||
return file_path, '/'.join(paths)
|
||||
return file_path, absolute_path
|
||||
|
||||
def save_files_snapshot(self, development_step_id):
|
||||
files = get_files_content(self.root_path, ignore=IGNORE_FOLDERS)
|
||||
|
||||
@@ -73,7 +73,7 @@ def test_get_full_path(file_path, file_name, expected):
|
||||
@pytest.mark.parametrize('file_path, file_name, expected', [
|
||||
('/file.txt', 'file.txt', '/file.txt'),
|
||||
('/path/to/file.txt', 'file.txt', '/path/to/file.txt'),
|
||||
('C:\\path\\to\\file.txt', 'file.txt', 'C:\\path\\to\\file.txt'),
|
||||
('C:\\path\\to\\file.txt', 'file.txt', 'C:\\path\\to/file.txt'),
|
||||
('~/path/to/file.txt', 'file.txt', '~/path/to/file.txt'),
|
||||
])
|
||||
def test_get_full_path_absolute(file_path, file_name, expected):
|
||||
|
||||
Reference in New Issue
Block a user