Skip to content

Commit

Permalink
fix test init project
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed Jul 23, 2024
1 parent 48763c3 commit 482d226
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def init_project(

return config, project_data

@fixture(scope='function')
@fixture(scope='session')
def setup_project_from_folder():
project = 'test_project_from_folder'
videos = ['./tests/tests_project_sample_data']
Expand Down
26 changes: 20 additions & 6 deletions tests/test_initialize_project.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path
from vame.util.auxiliary import read_config
from vame import init_new_project
import shutil


def test_project_config_exists(setup_project_not_aligned_data):
Expand All @@ -18,13 +19,26 @@ def test_project_name_config(setup_project_not_aligned_data):
assert config_values['Project'] == setup_project_not_aligned_data['project_name']


def test_existing_project(setup_project_not_aligned_data):
init_new_project(
project=setup_project_not_aligned_data['project_name'],
videos=setup_project_not_aligned_data['videos'],
poses_estimations=setup_project_not_aligned_data['videos'],
working_directory='./tests'
def test_existing_project():
project = 'test_existing_project'
videos = ['./tests/tests_project_sample_data/cropped_video.mp4']
poses_estimations = ['./tests/tests_project_sample_data/cropped_video.csv']
working_directory = './tests'

config_path_creation = init_new_project(
project=project,
videos=videos,
poses_estimations=poses_estimations,
working_directory=working_directory
)
config_path_duplicated = init_new_project(
project=project,
videos=videos,
poses_estimations=poses_estimations,
working_directory=working_directory
)
assert config_path_creation == config_path_duplicated
shutil.rmtree(Path(config_path_creation).parent)


def test_existing_project_from_folder(setup_project_from_folder):
Expand Down

0 comments on commit 482d226

Please sign in to comment.