def test_city_country_population(self): """Does adding a population to the city, country pair work?""" santiago_chile_50000 = city_country('santiago', 'chile', population=50000) self.assertEqual(santiago_chile_50000, 'Santiago, Chile - population 50000')
def test_city_country_population(self): test_city = city_country('santiago', 'chile', '50000') self.assertEqual(test_city, "Santiago, Chile - population 50000.")
def test_city_country_3(self): result = city_country('tokyo','japan') self.assertEqual(result,'Tokyo, Japan')
def test_city_country(self): city_and_country = city_country('Kiev', 'ukraine') self.assertEqual(city_and_country, 'Kiev, Ukraine')
def test_city_country_population(self): fn_city_country = city_country('Paris', 'France', '10000') self.assertEqual(fn_city_country, "Paris France population: 10000")
def test_city_country(self): formatted_name = city_country("Beni", "Kongo") self.assertEqual(formatted_name, "Beni,Kongo.")
def test_city_country_case(self): """Does a simple city and country pair work?""" santiago_chile = city_country('santiago', 'chile') self.assertEqual(santiago_chile, 'Santiago, Chile')
def test_city_country(self): testing_cities = city_country("berlin", "alemania") self.assertEqual(testing_cities, "Berlin, Alemania")
def test_city_country(self): """Does Santiago, Chile Work?""" formatted_city_country = city_country("santiago", "chile") self.assertEqual(formatted_city_country, "Santiago, Chile")
def test_city_country(self): city_country_name = city_country('santiago', 'chile') self.assertEqual(city_country_name, 'Santiago, Chile')
def test_city_country_population(self): city_country_name = city_country('santiago', 'chile', '5000000') self.assertEqual(city_country_name, 'Santiago, Chile 5000000')
def test_city_country_population(self): str = city_country('shanghai', 'china', 'population=10000') self.assertEqual(str, 'shanghai,china - population 10000')
def test_city_country(self): str = city_country('shanghai', 'china') self.assertEqual(str, 'shanghai,china')
from city_function import city_country print("Enter 'q' at any time to quit.") while True: city = input("\nPlease give me a city's name: ") if city == 'q': break country = input( "Please give me a country's name which matches the city you just input: " ) if country == 'q': break city_c = city_country(city, country) print(city_c)
def test_city_country(self): formatted = city_country('santiago', 'chile') self.assertEqual('Santiago, Chile', formatted)
def test_city_country(self): city_and_country = city_country('santiago', 'chile') self.assertEqual(city_and_country, 'Santiago, Chile')
import city_function print(city_function.city_country("kuala lumpur", "Malaysia"))
def test_city_country_population(self): city_and_country_population = city_country('santiago', 'chile', '5000000') self.assertEqual(city_and_country_population, 'Santiago, Chile - Population 5000000')
def test_city_country_population(self): """Can I include a population argument?""" santiago_chile = city_country('santiago', 'chile', population=5000000) self.assertEqual(santiago_chile, 'Santiago, Chile - population 5000000')
def test_city_country(self): self.assertEqual(city_country("santiago","chile"),"Santiago Chile")
def test_city_country_population(self): formatted_name = city_country("Beni", "Kongo", "700000") self.assertEqual(formatted_name, "Beni,Kongo,Population:700000.")
def test_city_country_population(self): self.assertEqual(city_country("santiago", "chile", "5000000"), "Santiago Chile - population 5000000")
def test_city_country(self): fn_city_country = city_country("Paris", "France") self.assertEqual(fn_city_country, "Paris France")
def test_city_country_population(self): """再编写一个名为test_city_country_population() 的测试, 核实可以使用类似于'santiago' 、 'chile' 和 'population=5000000' 这样的值来调用这个函数。 再次运行test_cities.py, 确认测试test_city_country_population() 通过了。""" information = city_country('shanghai', 'China', population=50000) self.assertEqual(information, 'Shanghai, China - Population 50000')
def test_city_country_population(self): city_and_country = city_country('Kiev', 'ukraine', '50000') self.assertEqual(city_and_country, 'Kiev, Ukraine - Population 50000.')
def test_city_country(self): information = city_country('beijing', 'China') self.assertEqual(information, 'Beijing, China')
def test_city_country_2(self): result = city_country('tokyo','japan','80000') self.assertEqual(result,'Tokyo, Japan - population 80000')
def test_city_country(self): formatted_city = city_country("bangkok", "thailand", 500000) self.assertEqual(formatted_city, "Bangkok, Thailand - population 500000")
def test_city_country_1(self): result = city_country('beijing','china') self.assertEqual(result,'Beijing,China')
def test_cityandcountry(self): test_city = city_country('santiago', 'chile') self.assertEqual(test_city, 'Santiago, Chile - population 0.')