def test_init(self): # Type Error due to abstract base class with self.assertRaises(TypeError): SimulationModule() # Initialization has te be done with correct settings with self.assertRaises(AssertionError): DummyModule(settings=None) # This is the easiest way settings = DummyModule.public_settings # check default attributes m = DummyModule(settings) m._settings["tick divider"] = 1 m._settings["step width"] = None # modules entry has to be deleted after init is completed with self.assertRaises(KeyError): m._settings["modules"] # check acquisition of attributes settings["tick divider"] = 1234 settings["step width"] = 13.26 # this _CANNOT_ be known a priori info = {0: dict(Name="Centripetal Force", Unit="Newton [N]")} settings["output info"] = info m = DummyModule(settings) self.assertEqual(m._settings["tick divider"], 1234) self.assertEqual(m._settings["step width"], None) self.assertEqual(m._settings["output info"], info)
def __init__(self, order): SimulationModule.__init__(self) self.order = order return
def __init__(self): SimulationModule.__init__(self) return