def test_user_has_items(self): user = User('Name') self.assertTrue(user.has(0, TREASURE)) self.assertEqual(user.inventory.count(TREASURE), 0) self.assertFalse(user.has(1, TREASURE)) user.to_inventory(TREASURE) self.assertTrue(user.has(1, TREASURE))
def test_user_put_item_to_inventory(self): user = User('Name') self.assertEqual(user.inventory.count(TREASURE), 0) user.to_inventory(TREASURE) self.assertEqual(user.inventory.count(TREASURE), 1)