def test_import_excel(consumption_xlsx_filename): ch = import_excel(consumption_xlsx_filename) assert len(ch.natural_gas) == 1 assert len(ch.electricity) == 1 assert_allclose(ch.natural_gas[0].therms,25,rtol=RTOL,atol=ATOL) assert_allclose(ch.electricity[0].kWh,1000,rtol=RTOL,atol=ATOL) assert ch.natural_gas[0].estimated assert not ch.electricity[0].estimated assert ch.natural_gas[0].timedelta.days == 30 assert ch.electricity[0].timedelta.days == 35
def test_import_excel(consumption_xlsx_filename): cd = import_excel(consumption_xlsx_filename) assert_allclose(cd.data.values,[25,np.nan],rtol=RTOL,atol=ATOL) assert_allclose(cd.estimated.values,[True,False],rtol=RTOL,atol=ATOL)