diff --git a/mdsapt/tests/test_sapt.py b/mdsapt/tests/test_sapt.py index 71c39cf..bf993a5 100644 --- a/mdsapt/tests/test_sapt.py +++ b/mdsapt/tests/test_sapt.py @@ -9,32 +9,26 @@ from ..config import Config, load_from_yaml_file from ..sapt import TrajectorySAPT, DockingSAPT +traj_settings = load_from_yaml_file( + os.path.join(os.getcwd(), 'mdsapt', 'tests', 'testing_resources', 'test_input.yaml')) + +dock_settings = load_from_yaml_file( + os.path.join(os.getcwd(), 'mdsapt', 'tests', 'testing_resources', 'docking_in.yaml')) + +unv = traj_settings.analysis.create_universe() +elements = guess_types(unv.atoms.names) +unv.add_TopologyAttr('elements', elements) class TestSAPT: """ Test object for SAPT analysis """ - traj_settings: Config - dock_settings: Config - unv: MDAnalysis.Universe - - def setup(self) -> None: - """ - Sets up system and config for other tests - """ - self.traj_settings = load_from_yaml_file( - os.path.join(os.getcwd(), 'mdsapt', 'tests', 'testing_resources', 'test_input.yaml')) - self.dock_settings = load_from_yaml_file( - os.path.join(os.getcwd(), 'mdsapt', 'tests', 'testing_resources', 'docking_in.yaml')) - self.unv = self.traj_settings.analysis.create_universe() - elements = guess_types(self.unv.atoms.names) - self.unv.add_TopologyAttr('elements', elements) def test_run_traj_sapt(self) -> None: """ Test running trajectory SAPT """ - sapt12 = TrajectorySAPT(self.traj_settings) + sapt12 = TrajectorySAPT(traj_settings) sapt12.run(1, 2) cols_act = sapt12.results.columns cols_exp = ['residues', 'time', 'total', 'electrostatic', @@ -47,7 +41,7 @@ def test_run_dock_sapt(self) -> None: """ Test running docking SAPT """ - docking = DockingSAPT(self.dock_settings) + docking = DockingSAPT(dock_settings) docking.run() cols_act = docking.results.columns cols_exp = ['structure', 'pair', 'total', 'electrostatic',