import unittest from GameObject import GameObject class TestGameObject(unittest.TestCase): def test_game_object_creation(self): obj = GameObject("sword", 1, True, True, False, "A sharp sword") self.assertEqual(obj.name, "sword") self.assertEqual(obj.location, 1) self.assertTrue(obj.movable) self.assertTrue(obj.visible) self.assertFalse(obj.carried) self.assertEqual(obj.description, "A sharp sword") def test_game_object_attributes_modification(self): obj = GameObject("shield", 2, False, False, True, "A sturdy shield") obj.carried = False obj.visible = True obj.location = 3 self.assertFalse(obj.carried) self.assertTrue(obj.visible) self.assertEqual(obj.location, 3) if __name__ == '__main__': unittest.main()