コード例 #1
0
 def test_add_csv_bulk(self):
     '''
     Adds the contents of the test data csv to the database
     This tests the bulk_add_customers and convert_csv methods
     '''
     parallel.bulk_add_customers(parallel.convert_csv('customers.csv'))
     assert Customer.select().count() == 10000
コード例 #2
0
def test_add_csv_bulk():
    '''
    Adds the contents of the test data csv to the database
    This tests the bulk_add_customers and convert_csv methods
    '''
    bo.bulk_add_customers(
        bo.convert_csv('lesson04_assignment_data_customer.csv'))
    assert Customer.select().count() == 10000 + len(customer_id_list)
コード例 #3
0
def list_active_customers():
    ''' Returns the number of active customers '''
    return Customer.select().where(Customer.status).count()
コード例 #4
0
ファイル: parallel.py プロジェクト: zconn/PythonCert220Assign
def get_customers_record_count():
    '''
    Get the Customers count
    '''
    return Customer.select().count()