Skip to content

Commit 9ab1c47

Browse files
committed
Add more tests for base
1 parent 17d34b0 commit 9ab1c47

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_base.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_gather_atoms(self):
5151

5252
ids = self.lmp.extract_atom("id")
5353
self.assertEqual(len(ids), 256)
54+
self.assertEqual(self.lmp.get_natoms(), 256)
5455

5556
def test_extract_fix(self):
5657
x = self.lmp.extract_fix("2", 0, 1, 1)
@@ -96,6 +97,29 @@ def test_extract_box(self):
9697
def test_cmdarg_options(self):
9798
self.assertTrue(os.path.isfile(self.citation_file))
9899

100+
def test_version(self):
101+
self.assertEqual(self.lmp.version, 20230802)
102+
103+
def test_extract_global(self):
104+
self.assertEqual(
105+
self.lmp.extract_global(name="boxhi"),
106+
[6.718384765530029, 6.718384765530029, 6.718384765530029]
107+
)
108+
self.assertEqual(
109+
self.lmp.extract_global(name="boxlo"),
110+
[0.0, 0.0, 0.0]
111+
)
112+
113+
def test_properties(self):
114+
self.assertEqual(self.lmp.has_exceptions, True)
115+
self.assertEqual(self.lmp.has_gzip_support, True)
116+
self.assertEqual(self.lmp.has_png_support, True)
117+
self.assertEqual(self.lmp.has_jpeg_support, True)
118+
self.assertEqual(self.lmp.has_ffmpeg_support, False)
119+
120+
def test_get_thermo(self):
121+
self.assertEqual(float(self.lmp.get_thermo("temp")), 1.1298532212880312)
122+
99123

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

0 commit comments

Comments
 (0)