def test_remove_tmp(self): testInst = Instance() testInst.createTmpRelations({}) testInst.tmp_agents = ['agent1', 'agent2'] testInst.removeTmpRelations() with self.assertRaises(AttributeError): testInst.tmp_agents
def test_create_tmp(self): instanceData = { 'formats': ['item1', 'item2'], 'agents': ['agent1', 'agent2', 'agent3'] } testInst = Instance() testInst.createTmpRelations(instanceData) self.assertEqual(testInst.tmp_formats[1], 'item2') self.assertEqual(len(testInst.tmp_agents), 3) self.assertEqual(testInst.items, set())