<commit_before>import unittest
from placefinder import PlaceFinder, InvalidSearchQueryException

KEY = "YOUR KEY"
SECRET = "YOUR SECRET"
APP_ID = "YOUR APP ID"

class PlaceFinderTests(unittest.TestCase):
	def setUp(self):
		self.placefinder = PlaceFinder(KEY, SECRET, APP_ID)

	def test_geocode_valid_freeform_returns_single_match(self):
		response, content, results = self.placefinder.geocode(q = "80 Delancey Street, New York, NY 10002")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead." % len(results))

	def test_geocode_address_only_returns_single_match(self):
		response, content, results = self.placefinder.geocode(line1 = "Spring Street")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead" % len(results))

	def test_geocode_invalid_address_returns_no_matches(self):
		response, content, results = self.placefinder.geocode(line1 = "9u523u4biwhbdfuwfwejb")
		self.assertEqual(0, len(results), "No records were expected to match. %s match(es) came back instead" % len(results))

	def test_geocode_invalid_search_query_raises_exception(self):
		self.assertRaises(InvalidSearchQueryException, self.placefinder.geocode)

	def test_geocode_getQualityDescription_99_returns_Coordniate(self):
		result = self.placefinder.getQualityDescription(99)
		self.assertEqual("Coordinate", result, "getQualityDescription(99) expected to return 'Coordinate'. Returned %s instead" % result)

	def test_geocode_getQualityDescription_62_returns_Airport(self):
		result = self.placefinder.getQualityDescription(62)
		self.assertEqual("Airport", result, "getQualityDescription(62) expected to return 'Airport'. Returned %s instead" % result)

	def test_geocodeFreeform_valid_address_returns_single_match(self):
		response, content, results = self.placefinder.geocodeFreeform("80 Delancey Street, New York, NY 10002")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead." % len(results))


def suite():
	suite = unittest.TestSuite()
	suite.addTest(unittest.makeSuite(PlaceFinderTests))

	return suite


if __name__ == "__main__":
	unittest.main(verbosity = 2)<commit_msg>Added an additional test for geocodeMultiline()<commit_after>import unittest
from placefinder import PlaceFinder, InvalidSearchQueryException

KEY = "YOUR KEY"
SECRET = "YOUR SECRET"
APP_ID = "YOUR APP ID"

class PlaceFinderTests(unittest.TestCase):
	def setUp(self):
		self.placefinder = PlaceFinder(KEY, SECRET, APP_ID)

	def test_geocode_valid_freeform_returns_single_match(self):
		response, content, results = self.placefinder.geocode(q = "80 Delancey Street, New York, NY 10002")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead." % len(results))

	def test_geocode_address_only_returns_single_match(self):
		response, content, results = self.placefinder.geocode(line1 = "Spring Street")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead" % len(results))

	def test_geocode_invalid_address_returns_no_matches(self):
		response, content, results = self.placefinder.geocode(line1 = "9u523u4biwhbdfuwfwejb")
		self.assertEqual(0, len(results), "No records were expected to match. %s match(es) came back instead" % len(results))

	def test_geocode_invalid_search_query_raises_exception(self):
		self.assertRaises(InvalidSearchQueryException, self.placefinder.geocode)

	def test_geocode_getQualityDescription_99_returns_Coordniate(self):
		result = self.placefinder.getQualityDescription(99)
		self.assertEqual("Coordinate", result, "getQualityDescription(99) expected to return 'Coordinate'. Returned %s instead" % result)

	def test_geocode_getQualityDescription_62_returns_Airport(self):
		result = self.placefinder.getQualityDescription(62)
		self.assertEqual("Airport", result, "getQualityDescription(62) expected to return 'Airport'. Returned %s instead" % result)

	def test_geocodeFreeform_valid_address_returns_single_match(self):
		response, content, results = self.placefinder.geocodeFreeform("80 Delancey Street, New York, NY 10002")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead." % len(results))

	def test_geocodeMultiline_valid_address_returns_single_match(self):
		response, content, results = self.placefinder.geocodeMultiline("80 Delancey Street", "New York", "NY", "10002")
		self.assertEqual(1, len(results), "One record was expected to match. %s match(es) came back instead." % len(results))

		
def suite():
	suite = unittest.TestSuite()
	suite.addTest(unittest.makeSuite(PlaceFinderTests))

	return suite


if __name__ == "__main__":
	unittest.main(verbosity = 2)
{'fraction_non_alphanumeric': 0.10336134453781512, 'fraction_numerical': 0.01764705882352941, 'mean_word_length': 6.921797004991681, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2852527', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1497, 'n_words': 364}