Beispiel #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')
Beispiel #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')
Beispiel #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.')
Beispiel #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')
Beispiel #5
0
 def test_city_country_populaton(self):
     formatted_city = get_formatted_city('kyiv', 'ukraine', '3000000')
     self.assertEqual(formatted_city, 'Kyiv, Ukraine - Population 3000000')
Beispiel #6
0
 def test_city_country(self):
     formatted_city = get_formatted_city('santiago', 'chile')
     self.assertEqual(formatted_city, 'Santiago, Chile')
 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')
Beispiel #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 + '.')
 def test_city_country(self):
     """Do names like 'Athens, Greece' work?"""
     formatted_city = get_formatted_city('athens', 'greece')
     self.assertEqual(formatted_city, 'Athens, Greece')
Beispiel #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}.")
Beispiel #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}.")
Beispiel #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')
Beispiel #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')
Beispiel #14
0
 def test_city_country(self):
     """Значения вида 'Santiago, Chile' дают правильную строку?"""
     formatted_city = get_formatted_city('santiago', 'chile')
     self.assertEqual(formatted_city, 'Santiago, Chile.')
Beispiel #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')
Beispiel #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}.")
Beispiel #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')
Beispiel #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')
Beispiel #19
0
 def test_first_last_population(self):
     formatted_city = get_formatted_city('louisville', 'America', '1000000')
     self.assertEqual(formatted_city, 'Louisville America 1000000')
 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')
Beispiel #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')
Beispiel #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')
Beispiel #23
0
 def test_get_formatted_city(self):
     cadillac_usa = get_formatted_city('cadillac', 'usa')
     self.assertEqual(cadillac_usa, 'Cadillac, Usa')
Beispiel #24
0
 def test_city_country_population(self):
     formatted_city = get_formatted_city('santiago', 'chile', '5000000')
     self.assertEqual(formatted_city,
                      'Santiago, Chile - Population 5000000')
Beispiel #25
0
 def test_city_country(self):
     formatted_city = get_formatted_city('kyiv', 'ukraine')
     self.assertEqual(formatted_city, 'Kyiv, Ukraine')