Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test files to data directory #3

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lipidorder/data/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"""

__all__ = [
"MDANALYSIS_LOGO", # example file of MDAnalysis logo
"MEMBRANE_GRO",
"MEMBRANE_XTC"
]

import importlib.resources

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

MDANALYSIS_LOGO = data_directory / "mda.txt"
MEMBRANE_GRO = data_directory / "membrane.gro"
MEMBRANE_XTC = data_directory / "membrane.xtc"
45 changes: 0 additions & 45 deletions lipidorder/data/mda.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions lipidorder/tests/test_lipidorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ def test_lipidorder_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "lipidorder" in sys.modules


def test_mdanalysis_logo_length(mdanalysis_logo_text):
"""Example test using a fixture defined in conftest.py"""
logo_lines = mdanalysis_logo_text.split("\n")
assert len(logo_lines) == 46, "Logo file does not have 46 lines!"
13 changes: 3 additions & 10 deletions lipidorder/tests/test_order_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@
import pytest
import os

from lipidorder.data.files import MEMBRANE_GRO, MEMBRANE_XTC


@pytest.fixture
def universe():
gro = "membrane.gro"
xtc = "membrane.xtc"
path = os.getcwd()
last_directory = (os.path.basename(path))
if last_directory == "lipidorderkit":
path = os.path.join(path,"lipidorder", "tests")
elif last_directory == "lipidorder":
path = os.path.join(path, "tests")

return mda.Universe(os.path.join(path, gro), os.path.join(path,xtc))
return mda.Universe(MEMBRANE_GRO, MEMBRANE_XTC)

@pytest.fixture
def n_chain():
Expand Down
Loading