Skip to content

Commit f423ee0

Browse files
authored
Merge pull request #3 from lilyminium/move-test-files
Move test files to data directory
2 parents 4b16fb2 + 7e4eda1 commit f423ee0

File tree

6 files changed

+7
-62
lines changed

6 files changed

+7
-62
lines changed

lipidorder/data/files.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
"""
1010

1111
__all__ = [
12-
"MDANALYSIS_LOGO", # example file of MDAnalysis logo
12+
"MEMBRANE_GRO",
13+
"MEMBRANE_XTC"
1314
]
1415

1516
import importlib.resources
1617

1718
data_directory = importlib.resources.files("lipidorder") / "data"
1819

19-
MDANALYSIS_LOGO = data_directory / "mda.txt"
20+
MEMBRANE_GRO = data_directory / "membrane.gro"
21+
MEMBRANE_XTC = data_directory / "membrane.xtc"

lipidorder/data/mda.txt

-45
This file was deleted.
File renamed without changes.
File renamed without changes.

lipidorder/tests/test_lipidorder.py

-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,3 @@ def test_lipidorder_imported():
1212
"""Sample test, will always pass so long as import statement worked"""
1313
assert "lipidorder" in sys.modules
1414

15-
16-
def test_mdanalysis_logo_length(mdanalysis_logo_text):
17-
"""Example test using a fixture defined in conftest.py"""
18-
logo_lines = mdanalysis_logo_text.split("\n")
19-
assert len(logo_lines) == 46, "Logo file does not have 46 lines!"

lipidorder/tests/test_order_parameters.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,12 @@
55
import pytest
66
import os
77

8+
from lipidorder.data.files import MEMBRANE_GRO, MEMBRANE_XTC
9+
810

911
@pytest.fixture
1012
def universe():
11-
gro = "membrane.gro"
12-
xtc = "membrane.xtc"
13-
path = os.getcwd()
14-
last_directory = (os.path.basename(path))
15-
if last_directory == "lipidorderkit":
16-
path = os.path.join(path,"lipidorder", "tests")
17-
elif last_directory == "lipidorder":
18-
path = os.path.join(path, "tests")
19-
20-
return mda.Universe(os.path.join(path, gro), os.path.join(path,xtc))
13+
return mda.Universe(MEMBRANE_GRO, MEMBRANE_XTC)
2114

2215
@pytest.fixture
2316
def n_chain():

0 commit comments

Comments
 (0)