def test_search_customer():
    ''' Search for an expected customer '''
    search_good = dict(customer_data)
    customer_id = "search"
    search_good['customer_id'] = customer_id

    bo.add_customer(**search_good)
    result = bo.search_customer(customer_id)

    assert isinstance(result, dict)
    assert result["name"] == search_good["name"]
    assert result["lastname"] == search_good["lastname"]
    assert result["email_address"] == search_good["email_address"]
    assert result["phone_number"] == search_good["phone_number"]
Esempio n. 2
0
 def test_search_customer_fail(self):
     """tests the search_customer functionality"""
     added_customer = {
         'customer_id': 'EJ9ER',
         'first_name': 'Jennifer',
         'last_name': 'Robot',
         'home_address': '2324 Main Street',
         'phone_number': '6197602020',
         'email_address': '*****@*****.**',
         'status': 'Active',
         'credit_limit': 15000.00
     }
     add_customer(**added_customer)
     compare = {}
     self.assertEqual(compare, search_customer('LS123'))
def test_delete_customer_ok():
    ''' delete and verify customer '''
    bo.delete_customer("delete_customer_good")
    result = bo.search_customer("delete_customer_good")
    assert result == {}
def test_search_customer_missing():
    ''' search for a missing customer '''
    result = bo.search_customer("search_bad")
    assert result == {}