Ejemplo n.º 1
0
 def test_formatted_city_country_population(self):
     """能够正确地返回像Santiago, Chile - population 5000000"""
     formatted_city = get_formatted_city('santiago',
                                         'chile',
                                         population=5000000)
     self.assertEqual(formatted_city,
                      'Santiago, Chile - population 5000000')
Ejemplo n.º 2
0
 def test_city_country_population(self):
     """Do cities like 'Santiago, Chile - population 5000000' work?"""
     formatted_city = get_formatted_city('santiago',
                                         'chile',
                                         population=5000000)
     self.assertEqual(formatted_city,
                      'Santiago, Chile - Population 5000000')
Ejemplo n.º 3
0
 def test_city_country_population(self):
     """Значения вида 'Santiago, Chile — population 5000000.' дают правильную строку?"""
     formatted_city = get_formatted_city('santiago', 'chile', '5000000')
     self.assertEqual(formatted_city,
                      'Santiago, Chile — population 5000000.')
Ejemplo n.º 4
0
 def test_get_formatted_city_population(self):
     cadillac_usa = get_formatted_city('cadillac', 'usa', population=10000)
     self.assertEqual(cadillac_usa, 'Cadillac, Usa - Population: 10000')
Ejemplo n.º 5
0
 def test_city_country_populaton(self):
     formatted_city = get_formatted_city('kyiv', 'ukraine', '3000000')
     self.assertEqual(formatted_city, 'Kyiv, Ukraine - Population 3000000')
Ejemplo n.º 6
0
 def test_city_country(self):
     formatted_city = get_formatted_city('santiago', 'chile')
     self.assertEqual(formatted_city, 'Santiago, Chile')
Ejemplo n.º 7
0
 def test_city_country(self):
     """Czy dane w postaci 'Santiago, Chile' są obsługiwane dobrze"""
     formatted_city = get_formatted_city('santiago', 'chile')
     self.assertEqual(formatted_city, 'Santiago, Chile')
Ejemplo n.º 8
0
#!/usr/bin/env python
# cities.py: exercise 11-1 (call get_formatted_city)
# 4 Sep 2018 | fjgl
from city_functions import get_formatted_city

print("Enter 'q' at any time to quit.")
while True:
    city = input("\nPlease enter a city: ")
    if city == 'q':
        break
    country = input("Please enter a country: ")
    if country == 'q':
        break

    formatted_city = get_formatted_city(city, country)
    print("Formatted city: " + formatted_city + '.')
Ejemplo n.º 9
0
 def test_city_country(self):
     """Do names like 'Athens, Greece' work?"""
     formatted_city = get_formatted_city('athens', 'greece')
     self.assertEqual(formatted_city, 'Athens, Greece')
Ejemplo n.º 10
0
from city_functions import get_formatted_city

print("Enter 'q' at any time to quit.")
while True:
    town = input("\nPlease a name of city: ")
    if town == 'q':
        break
    country = input("Please enter a name of country: ")
    if country == 'q':
        break

    formatted_city = get_formatted_city(town, country)
    print(f"\tNeatly formatted name: {formatted_city}.")
Ejemplo n.º 11
0
from city_functions import get_formatted_city

print("Enter 'q' at any time to quit.")
while True:
    first = input("\nPlease give me a first name: ")
    if first == 'q':
        break
    last = input("Please give me a last name: ")
    if last == 'q':
        break

    formatted_city = get_formatted_city(first, last)
    print(f"\tNeatly formatted city name: {formatted_city}.")
Ejemplo n.º 12
0
 def test_first_last_name(self):
     '''Do name like Houston, Texas work?'''
     formatted_city = get_formatted_city('houston', 'texas')
     self.assertEqual(formatted_city, 'Houston, Texas')
Ejemplo n.º 13
0
 def test_first_last_name_population(self):
     '''Do name like Houston, Texas  work?'''
     formatted_city = get_formatted_city('houston', 'texas', '1200000000')
     self.assertEqual(formatted_city,
                      'Houston, Texas, Population: 1200000000')
Ejemplo n.º 14
0
 def test_city_country(self):
     """Значения вида 'Santiago, Chile' дают правильную строку?"""
     formatted_city = get_formatted_city('santiago', 'chile')
     self.assertEqual(formatted_city, 'Santiago, Chile.')
Ejemplo n.º 15
0
 def test_city_country_population(self):
     """Do names like 'Santiago, Chile - population 5000000' work?"""
     city_name = get_formatted_city('santiago', 'chile', '5000000')
     self.assertEqual(city_name, 'Santiago, Chile - Population 5000000')
Ejemplo n.º 16
0
from city_functions import get_formatted_city

print("Enter 'q' at any time to quit.")
while True:
    city = input("\nPlease enter a city: ")
    if city == 'q':
        break
    country = input("Please enter a country: ")
    if country == 'q':
        break
    population = input("Please enter the population: ")
    if population == 'q':
        break
    formatted_city = get_formatted_city(city, country, population)
    print(f"\tFormatted City Information: {formatted_city}.")
Ejemplo n.º 17
0
 def test_city_country(self):
     """Do names like 'Santiago, Chile' work?"""
     city_name = get_formatted_city('santiago', 'chile')
     self.assertEqual(city_name, 'Santiago, Chile')
Ejemplo n.º 18
0
 def test_city_country(self):
     """Do cities like 'Santiago, Chile' work?"""
     formatted_city = get_formatted_city('santiago', 'chile')
     self.assertEqual(formatted_city, 'Santiago, Chile')
Ejemplo n.º 19
0
 def test_first_last_population(self):
     formatted_city = get_formatted_city('louisville', 'America', '1000000')
     self.assertEqual(formatted_city, 'Louisville America 1000000')
Ejemplo n.º 20
0
 def test_city_country_population(self):
     """Czy dane w postaci 'Santiago, Chile - populacja 5000000' są obsługiwane dobrze"""
     formatted_city = get_formatted_city('santiago', 'chile', 5000000)
     self.assertEqual(formatted_city, 'Santiago, Chile - populacja 5000000')
Ejemplo n.º 21
0
 def test_city_country(self):
     """Do names like "Atascadero America' work?"""
     formatted_city = get_formatted_city('Atascadero', 'Atascadero')
     self.assertEqual(formatted_city, 'Atascadero Atascadero')
Ejemplo n.º 22
0
 def test_city_country(self):
     """ Do names like 'Cupertino, United States' work? """
     full_city_info = get_formatted_city('cupertino', 'united states')
     self.assertEqual(full_city_info, 'Cupertino, United States')
Ejemplo n.º 23
0
 def test_get_formatted_city(self):
     cadillac_usa = get_formatted_city('cadillac', 'usa')
     self.assertEqual(cadillac_usa, 'Cadillac, Usa')
Ejemplo n.º 24
0
 def test_city_country_population(self):
     formatted_city = get_formatted_city('santiago', 'chile', '5000000')
     self.assertEqual(formatted_city,
                      'Santiago, Chile - Population 5000000')
Ejemplo n.º 25
0
 def test_city_country(self):
     formatted_city = get_formatted_city('kyiv', 'ukraine')
     self.assertEqual(formatted_city, 'Kyiv, Ukraine')