Skip to content
Snippets Groups Projects
Commit faa02a1f authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Removed unnecessary access of results by index 0 from test cases.

parent bc6c6072
Branches
Tags 1.2.0
No related merge requests found
...@@ -210,13 +210,13 @@ class TestSinglePoint(unittest.TestCase): ...@@ -210,13 +210,13 @@ class TestSinglePoint(unittest.TestCase):
def test_section_method_atom_kind(self): def test_section_method_atom_kind(self):
kind = self.results["section_method_atom_kind"][0] kind = self.results["section_method_atom_kind"][0]
self.assertEqual(kind["method_atom_kind_atom_number"][0], 1) self.assertEqual(kind["method_atom_kind_atom_number"], 1)
self.assertEqual(kind["method_atom_kind_label"][0], "H") self.assertEqual(kind["method_atom_kind_label"], "H")
def test_section_method_basis_set(self): def test_section_method_basis_set(self):
kind = self.results["section_method_basis_set"][0] kind = self.results["section_method_basis_set"][0]
self.assertEqual(kind["method_basis_set_kind"][0], "wavefunction") self.assertEqual(kind["method_basis_set_kind"], "wavefunction")
self.assertTrue(np.array_equal(kind["mapping_section_method_basis_set_cell_associated"][0], 0)) self.assertTrue(np.array_equal(kind["mapping_section_method_basis_set_cell_associated"], 0))
def test_single_configuration_to_calculation_method_ref(self): def test_single_configuration_to_calculation_method_ref(self):
result = self.results["single_configuration_to_calculation_method_ref"] result = self.results["single_configuration_to_calculation_method_ref"]
...@@ -671,15 +671,16 @@ class TestMDPrintSettings(unittest.TestCase): ...@@ -671,15 +671,16 @@ class TestMDPrintSettings(unittest.TestCase):
systems = results["section_system"] systems = results["section_system"]
for i_scc, scc in sccs.items(): for i_scc, scc in sccs.items():
ref = scc["single_configuration_calculation_to_system_ref"][0] ref = scc["single_configuration_calculation_to_system_ref"]
system = systems[ref] system = systems[ref]
pos = system["atom_positions"] pos = system["atom_positions"]
vel = system["atom_velocities"] vel = system["atom_velocities"]
forces = scc["atom_forces"] forces = scc["atom_forces"]
if i_scc % 3 == 0: if i_scc % 3 == 0:
self.assertNotEqual(pos, None) pass
self.assertNotEqual(vel, None) self.assertFalse(pos is None)
self.assertNotEqual(forces, None) self.assertFalse(vel is None)
self.assertFalse(forces is None)
else: else:
self.assertEqual(pos, None) self.assertEqual(pos, None)
self.assertEqual(vel, None) self.assertEqual(vel, None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment