Exemplo n.º 1
0
 def test_load_customers(cls):
     """ Ensure that the delete_customers function deletes all customers"""
     assert basic_operations.create_database()
     assert basic_operations.get_active_customer_count() == 0
     basic_operations.load_customers()
     assert basic_operations.get_active_customer_count() > 0
     basic_operations.delete_customers()
Exemplo n.º 2
0
 def test_get_existing_customer(cls):
     """
     Ensure that creating a customer that already exists
     gets the existing customer
     """
     assert basic_operations.create_database()
     basic_operations.load_customers()
     customer = basic_operations.create_or_get_customer(
         1, '', '', '', '', '')
     created_customer = basic_operations.create_or_get_customer(
         0, customer.name, customer.last_name, customer.address,
         customer.phone_number, customer.email)
     assert customer.name == created_customer.name
     assert customer.last_name == created_customer.last_name
     assert customer.address == created_customer.address
     assert customer.phone_number == created_customer.phone_number
     assert customer.email == created_customer.email
     found = basic_operations.search_customer(1)
     assert len(found) == 1
     basic_operations.delete_customers()
Exemplo n.º 3
0
 def test_list_inactive_customers(cls):
     """ Ensure that active customer count is correct """
     assert basic_operations.create_database()
     basic_operations.load_customers()
     assert len(basic_operations.list_inactive_customers()) > 0
     basic_operations.delete_customers()