def setUp(self): adapter = mock.Mock() taskModel = mock.Mock() self.km = KlassMap(adapter=adapter, namespace="foo-ins1", taskModel=taskModel) self.tm1 = TaskMapBase(klass=0) self.tm1.__class__._Item = DummyTaskItem self.km.addTaskMap(self.tm1) self.tm2 = TaskMapBase(klass=1) self.tm2.__class__._Item = DummyTaskItem self.km.addTaskMap(self.tm2) self.am = mock.Mock() self.km.setAdapterMap(self.am)
def test_create_same_klass(self): # try add it again, but with the same class tm1_1 = TaskMapBase(klass=0) self.assertRaises(RuntimeError, self.km.addTaskMap, tm1_1)
def setUp(self): self.tm = TaskMapBase(klass=0) self.tm.__class__._Item = DummyTaskItem