def test_city_dict_2(self): """Tests dictionaries of two instances of a City""" city1 = City("id1", "name1", "state1", "region1", "companies1", "finorgs1", "people1") c1_dict = city1.dictionary() city2 = City("id2", "name1", "state2", "region1", "companies2", "finorgs1", "people2") c2_dict = city2.dictionary() self.assertNotEqual(c1_dict["city_id"], c2_dict["city_id"]) self.assertEqual(c1_dict["name"], c2_dict["name"]) self.assertNotEqual(c1_dict["state"], c2_dict["state"]) self.assertEqual(c1_dict["region"], c2_dict["region"]) self.assertNotEqual(c1_dict["companies"], c2_dict["companies"]) self.assertEqual(c1_dict["financial_orgs"], c2_dict["financial_orgs"]) self.assertNotEqual(c1_dict["people"], c2_dict["people"])
def test_city_dict_3(self): """Test dictionary of a City with more realistic information""" city1 = City("1", "Seattle", "WA", "Seattle", "Wetpaint", "Vulcan Capital", "Mathias Klein") c1_dict = city1.dictionary() self.assertIsInstance(c1_dict, dict) self.assertEqual(c1_dict, {"city_id": "1", "name": "Seattle", "state": "WA", "region": "Seattle", "companies": "Wetpaint", "financial_orgs": "Vulcan Capital", "people": "Mathias Klein"})
def test_city_dict_1(self): """Tests dictionary of a City""" city1 = City("id1", "name1", "state1", "region1", "companies1", "finorgs1", "people1") c1_dict = city1.dictionary() self.assertIsInstance(c1_dict, dict) self.assertEqual(c1_dict, {"city_id": "id1", "name": "name1", "state": "state1", "region": "region1", "companies": "companies1", "financial_orgs": "finorgs1", "people": "people1"})