《高级编程技术》第六周作业

11-1 城市和国家:

①name_function.py:

def get_name(city, country):
	return city.title() + ', ' + country.title()

②test_cities.py:

import unittest
from name_function import get_name

class Test(unittest.TestCase):
	def test_city_country(self):
		formatted_name = get_name('santiage', 'chile')
		self.assertEqual(formatted_name, 'Santiage, Chile')

unittest.main()

猜你喜欢

转载自blog.csdn.net/weixin_36348299/article/details/79952994