refactor: replace Logger with RunLogger and streamline logging setup
This commit is contained in:
24
tests/environment/test_system.py
Normal file
24
tests/environment/test_system.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from diceplayer.environment import Molecule, System
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestSystem(unittest.TestCase):
|
||||
def test_class_instantiation(self):
|
||||
system = System()
|
||||
|
||||
self.assertIsInstance(system, System)
|
||||
|
||||
def test_add_type(self):
|
||||
system = System()
|
||||
system.add_type(Molecule("test"))
|
||||
|
||||
self.assertIsInstance(system.molecule, list)
|
||||
|
||||
with self.assertRaises(TypeError) as ex:
|
||||
system.add_type("test")
|
||||
self.assertEqual(ex.exception, "Error: molecule is not a Molecule instance")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user