예제 #1
0
    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)
예제 #2
0
 def __init__(self, order):
     SimulationModule.__init__(self)
     self.order = order
     return
예제 #3
0
파일: observer.py 프로젝트: cklb/pymoskito
 def __init__(self):
     SimulationModule.__init__(self)
     return
예제 #4
0
파일: observer.py 프로젝트: mfr13/pymoskito
 def __init__(self):
     SimulationModule.__init__(self)
     return