def test_add_nbhd_zip_language_nbhd_and_zip(self): """Test add_nbhd_zip_language() with zip and neighborhood.""" input = "Current sentence" expected = "Current sentence in the Gert Town neighborhood and 70125" rl = ResultsLanguage(standard_data) actual = rl.add_nbhd_zip_language(input) self.assertEqual(actual, expected)
def test_add_nbhd_zip_language_nbhd_only(self): """Test add_nbhd_zip_language() with neighborhood only.""" input = "Current sentence" expected = "Current sentence in the Gert Town neighborhood" new_data = copy.deepcopy(standard_data) new_data["zip_code"] = "" rl = ResultsLanguage(new_data) actual = rl.add_nbhd_zip_language(input) self.assertEqual(actual, expected)
def test_add_nbhd_zip_language_nothing_new(self): """Test add_nbhd_zip_language() nothing new.""" input = "Current sentence" expected = "Current sentence" new_data = copy.deepcopy(standard_data) new_data["neighborhood"] = "" new_data["zip_code"] = "" rl = ResultsLanguage(new_data) actual = rl.add_nbhd_zip_language(input) self.assertEqual(actual, expected)