def test_compare_keys_population_less_than(self): key1 = FuzzyMatchingKey(state='CA', city='Mountain View', population=1) key2 = FuzzyMatchingKey(state='CA', city='Sunnyvale', population=102) self.assertEqual(fbi_data_table.compare_keys(key1, key2), -1)
def test_read(self): df = fbi_data_table.read( 'data/fbi/Table_8_Offenses_Known_to_Law_Enforcement_by_State_by_City_2017.xls' ) self.assertEqual(len(df), 9589)
def test_compare_keys_equal_wrong_population(self): key1 = FuzzyMatchingKey(state='CA', city='Sunnyvale City', population=100) key2 = FuzzyMatchingKey(state='CA', city='Sunnyvale', population=200) self.assertEquals(fbi_data_table.compare_keys(key1, key2), 1)
def test_get_population_key(self): self.assertEqual(fbi_data_table.get_population_key(), 'population')
def test_get_city_key(self): self.assertEqual(fbi_data_table.get_city_key(), 'city')
def test_get_state_key(self): self.assertEqual(fbi_data_table.get_state_key(), 'state')
def test_get_exact_matching_key(self): self.assertEqual(fbi_data_table.get_exact_matching_key(), 'index')