示例#1
0
def test_no_duplicate_invoice_ids_elec():
    result = preprocess_electricity(
        '/home/vidal/Projects/cityofchicago/2FM/data/energy/energy.xlsx')
    assert len(result['invoice_id'].unique()) == len(
        result), "There are duplicate invoice numbers in this data."
示例#2
0
def test_send_elec_data_to_database():
    engine = create_mysql_engine('./tests/test_creds.yml')
    data = preprocess_electricity(
        '/home/vidal/Projects/cityofchicago/2FM/data/energy/energy.xlsx')
    data_to_db(data, 'elec_usage', engine)
示例#3
0
def test_statement_no_column_formatted_as_str():
    result = preprocess_electricity(
        '/home/vidal/Projects/cityofchicago/2FM/data/energy/energy.xlsx')
    assert result.statement_number.dtype == object
示例#4
0
def test_elec_no_of_columns_correct():
    result = preprocess_electricity(
        '/home/vidal/Projects/cityofchicago/2FM/data/energy/energy.xlsx')
    assert result.shape[1] == 13
示例#5
0
def test_elec_column_names_renamed_appropriately():
    result = preprocess_electricity(
        '/home/vidal/Projects/cityofchicago/2FM/data/energy/energy.xlsx')
    assert 'statement_number' in result.columns