Skip to content

Commit

Permalink
move to conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed Jul 29, 2024
1 parent 3dcddb5 commit 3a7b5b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ def setup_project_nwb_data():
# Clean up
shutil.rmtree(Path(config).parent)

@fixture(scope='session')
def setup_nwb_project_and_align_egocentric(setup_project_nwb_data):
config_path = setup_project_nwb_data['config_path']
vame.egocentric_alignment(
config_path,
pose_ref_index=setup_project_nwb_data["pose_ref_index"],
save_logs=True,
)
return setup_project_nwb_data


@fixture(scope='session')
def setup_project_and_convert_pose_to_numpy(setup_project_fixed_data):
Expand Down
1 change: 1 addition & 0 deletions tests/test_initialize_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_existing_project():
shutil.rmtree(Path(config_path_creation).parent)



def test_existing_project_from_folder(setup_project_from_folder):
config = Path(setup_project_from_folder['config_path'])
config_values = read_config(config)
Expand Down
18 changes: 5 additions & 13 deletions tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import vame
import pytest
import os

import pytest

def test_pose_to_numpy_file_exists(setup_project_and_convert_pose_to_numpy):
"""
Expand All @@ -23,19 +21,13 @@ def test_egocentric_alignment_file_is_created(setup_project_and_align_egocentric
assert os.path.exists(file_path)



def test_egocentric_alignment_file_is_created_nwb_data(setup_project_nwb_data):
@pytest.mark.skip(reason='skip test')
def test_egocentric_alignment_file_is_created_nwb_data(setup_nwb_project_and_align_egocentric):
"""
Test if the egocentric alignment function creates the expected file using NWB data.
"""
config_path = setup_project_nwb_data['config_path']
vame.egocentric_alignment(
config_path,
pose_ref_index=setup_project_nwb_data["pose_ref_index"],
save_logs=True,
)
project_path = setup_project_nwb_data['config_data']['project_path']
file_name = setup_project_nwb_data['config_data']['video_sets'][0]
project_path = setup_nwb_project_and_align_egocentric['config_data']['project_path']
file_name = setup_nwb_project_and_align_egocentric['config_data']['video_sets'][0]
file_path = os.path.join(project_path,'data', file_name, f'{file_name}-PE-seq.npy')
assert os.path.exists(file_path)

Expand Down

0 comments on commit 3a7b5b7

Please sign in to comment.