def test_create_new_customer_no_country_code(self): customer_info = { 'name': '15551212', 'postal_code': 'Unknown' } with self.assertRaises(customers.MissingProperty): customers.create_customer(tests.CONNECTION, customer_info)
def test_create_new_customer_using_country_name(self): customer_info = { 'name': '15551212111', 'country': 'United States', 'postal_code': '79762' } with self.assertRaises(customers.InvalidCountryCodeException): customers.create_customer(tests.CONNECTION, customer_info)
def test_create_new_customer_duplicate_found(self): customer_info = { 'name': '5551212', 'country': 'US', 'postal_code': '79762' } with self.assertRaises(customers.DuplicateCustomerException): customers.create_customer(tests.CONNECTION, customer_info)
def test_create_new_customer_duplicate_found(self): customer_info = { 'name': '5551212', 'country': 'US', 'postal_code': '79762' } with self.assertRaises(customers.DuplicateCustomerException): customers.create_customer( tests.CONNECTION, customer_info )
def test_create_new_customer(self): customer_info = { 'name': '15551212', 'country': 'US', 'postal_code': '79762' } new_customer = customers.create_customer(tests.CONNECTION, customer_info) # the api returns country name but expcets country code customer_info['country'] = 'United States' self.assertDictContainsSubset(customer_info, new_customer)
def test_create_new_customer_no_country_code(self): customer_info = {'name': '15551212', 'postal_code': 'Unknown'} with self.assertRaises(customers.MissingProperty): customers.create_customer(tests.CONNECTION, customer_info)