def test_dcop_add_agents_from_dict(): dcop = DCOP() agts = create_agents('a', [1, 2, 3]) dcop.add_agents(agts) assert dcop.agent('a1').name == 'a1' assert dcop.agent('a2').name == 'a2' assert dcop.agent('a3').name == 'a3'
def test_dcop_add_agents_from_list(): dcop = DCOP() a1 = AgentDef('a1') a2 = AgentDef('a2') dcop.add_agents([a1, a2]) assert dcop.agent('a1').name == 'a1' assert dcop.agent('a2').name == 'a2'
def test_dcop_add_single_agent(): dcop = DCOP() a1 = AgentDef('a1') dcop.add_agents(a1) assert dcop.agent('a1').name == 'a1'