コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 def test_get_population_key(self):
   self.assertEqual(fbi_data_table.get_population_key(), 'population')
コード例 #5
0
 def test_get_city_key(self):
   self.assertEqual(fbi_data_table.get_city_key(), 'city')
コード例 #6
0
 def test_get_state_key(self):
   self.assertEqual(fbi_data_table.get_state_key(), 'state')
コード例 #7
0
 def test_get_exact_matching_key(self):
   self.assertEqual(fbi_data_table.get_exact_matching_key(), 'index')