def test_get_all_customers_from_file(self): self.assertEqual( list(islice(get_all_customers_from_file("customers.json"), 1)), [{ u'latitude': u'52.986375', u'user_id': 12, u'name': u'Christina McArdle', u'longitude': u'-6.043701' }])
def test_get_customers_in_a_range_of_100km(self): customers = get_all_customers_from_file("customers.json") customers_in_100Km_range = get_customers_in_a_range_of_100km(customers) self.assertEqual(32, len(customers)) self.assertEqual(16, len(customers_in_100Km_range))
def test_get_all_customers_from_file(self): self.assertEqual( list(islice(get_all_customers_from_file("customers.json"), 1)), [{u'latitude': u'52.986375', u'user_id': 12, u'name': u'Christina McArdle', u'longitude': u'-6.043701'}])
def test_get_all_customers_from_file_with_wrong_path_file(self): self.assertRaises(IOError, lambda: list(get_all_customers_from_file("wrong_path")))
def test_get_all_customers_from_file_with_wrong_path_file(self): self.assertRaises( IOError, lambda: list(get_all_customers_from_file("wrong_path")))