def test_format_city_country(self): """Do cities like Arlington, Texas work?""" formatted_city = format_city('Arlington', 'Texas') self.assertEqual(formatted_city, 'Arlington, Texas')
def test_city_country_population(self): formatted_city = format_city('santiago', 'chile', '5000000') self.assertEqual(formatted_city, 'Santiago, Chile - Population 5000000')
def test_format_city_country_population(self): """Do cities like Santiago, Chile - population 5000000 work?""" formatted_city = format_city('Santiago', 'Chile', '5000000') self.assertEqual(formatted_city, 'Santiago, Chile - population 5000000')
def test_city_country(self): formatted_city = format_city('santiago', 'chile') self.assertEqual(formatted_city, 'Santiago, Chile')
def test_simple_case(self): result = format_city('roma', 'italia') self.assertEqual(result, 'Roma, Italia')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 2021-04-18,Sun,8:42 @author: rrolison """ from city_functions import format_city print("Enter 'q' at any time to quit.") while True: ci = input("Please enter a city's name: ") if ci == 'q': break co = input("Please input the country's name: ") if co == 'q': break city = format_city(ci, co) print(f"Formatted city: {city}")
def test_city_population(self): """Does Seoul work with population added?""" pop = format_city('seoul', 'south korea', '9700000') self.assertEqual(pop, 'Seoul, South Korea, 9700000')
def test_city_format(self): """Do cities like Seoul South Korea work?""" city = format_city('seoul', 'south korea') self.assertEqual(city, 'Seoul, South Korea')