Skip to content

Commit

Permalink
Add more tests for base
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Jan 4, 2024
1 parent 17d34b0 commit 9ab1c47
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_gather_atoms(self):

ids = self.lmp.extract_atom("id")
self.assertEqual(len(ids), 256)
self.assertEqual(self.lmp.get_natoms(), 256)

def test_extract_fix(self):
x = self.lmp.extract_fix("2", 0, 1, 1)
Expand Down Expand Up @@ -96,6 +97,29 @@ def test_extract_box(self):
def test_cmdarg_options(self):
self.assertTrue(os.path.isfile(self.citation_file))

def test_version(self):
self.assertEqual(self.lmp.version, 20230802)

def test_extract_global(self):
self.assertEqual(
self.lmp.extract_global(name="boxhi"),
[6.718384765530029, 6.718384765530029, 6.718384765530029]
)
self.assertEqual(
self.lmp.extract_global(name="boxlo"),
[0.0, 0.0, 0.0]
)

def test_properties(self):
self.assertEqual(self.lmp.has_exceptions, True)
self.assertEqual(self.lmp.has_gzip_support, True)
self.assertEqual(self.lmp.has_png_support, True)
self.assertEqual(self.lmp.has_jpeg_support, True)
self.assertEqual(self.lmp.has_ffmpeg_support, False)

def test_get_thermo(self):
self.assertEqual(float(self.lmp.get_thermo("temp")), 1.1298532212880312)


if __name__ == "__main__":
unittest.main()

0 comments on commit 9ab1c47

Please sign in to comment.