def test_open_checking_account(database_setup): conn = database_setup customer_service = CustomerService(conn) customer = customer_service.create_retail_customer(11111, "555-555-5555", "*****@*****.**", "111-11-1111", "John", "Doe") acct = customer_service.open_checking_account( customer_id=customer.customer_id, deposit_amount=2000.0) accounts = customer_service.list_accounts(customer_id=customer.customer_id) assert len(accounts) == 1 assert accounts[0] == acct
def test_list_accounts(database_setup): conn = database_setup customer_service = CustomerService(conn) account_service = AccountService(conn) customer = customer_service.create_retail_customer(11111, "555-555-5555", "*****@*****.**", "111-11-1111", "John", "Doe") customer_id = customer.customer_id account_service.create_checking_account(customer) account_service.create_checking_account(customer) account_service.create_checking_account(customer) accounts = customer_service.list_accounts(customer_id) assert len(accounts) == 3