Skip to content

Commit

Permalink
updated all tests to use conftest shared file
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Mar 18, 2024
1 parent d8fdc1b commit dfa7585
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 514 deletions.
17 changes: 17 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@
from mdagent.utils import PathRegistry


@pytest.fixture
def path_to_cif():
# Save original working directory
original_cwd = os.getcwd()

# Change current working directory to the directory where the CIF file is located
tests_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(tests_dir)

# Yield the filename only
filename_only = "3pqr.cif"
yield filename_only

# Restore original working directory after the test is done
os.chdir(original_cwd)


@pytest.fixture(scope="module")
def raw_alanine_pdb_file(request):
pdb_content = """
Expand Down
17 changes: 0 additions & 17 deletions tests/test_analysis_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@ def vis_fxns(get_registry):
return VisFunctions(get_registry("raw", False))


@pytest.fixture
def path_to_cif():
# Save original working directory
original_cwd = os.getcwd()

# Change current working directory to the directory where the CIF file is located
tests_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(tests_dir)

# Yield the filename only
filename_only = "3pqr.cif"
yield filename_only

# Restore original working directory after the test is done
os.chdir(original_cwd)


def test_process_csv(plotting_tools):
mock_csv_content = "Time,Value1,Value2\n1,10,20\n2,15,25"
mock_reader = MagicMock()
Expand Down
Loading

0 comments on commit dfa7585

Please sign in to comment.