def test_removeItem(self): """ You can remove items from a list """ ev = MagicMock() world = World(ev) obj = world.create('foo') world.addItem(obj['id'], 'foo', 'bar') ev.reset_mock() world.removeItem(obj['id'], 'foo', 'bar') ev.assert_any_call(ItemRemoved(obj['id'], 'foo', 'bar')) self.assertEqual(world.get(obj['id'])['foo'], [])
def test_removeItem(self): """ You can remove items from a list """ ev = MagicMock() world = World(ev) obj = world.create('foo') world.addItem(obj['id'], 'foo', 'bar') ev.reset_mock() world.removeItem(obj['id'], 'foo', 'bar') ev.assert_any_call(ItemRemoved(obj['id'], 'foo', 'bar')) self.assertEqual(world.get(obj['id'])['foo'], [])
def test_addItem(self): """ You can add items to a list """ ev = MagicMock() world = World(ev) obj = world.create('foo') ev.reset_mock() world.addItem(obj['id'], 'foo', 'bar') ev.assert_any_call(ItemAdded(obj['id'], 'foo', 'bar')) obj = world.get(obj['id']) self.assertEqual(obj['foo'], ['bar'])
def test_addItem(self): """ You can add items to a list """ ev = MagicMock() world = World(ev) obj = world.create('foo') ev.reset_mock() world.addItem(obj['id'], 'foo', 'bar') ev.assert_any_call(ItemAdded(obj['id'], 'foo', 'bar')) obj = world.get(obj['id']) self.assertEqual(obj['foo'], ['bar'])