File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11"""Tests for update_sensor.py."""
2- from datetime import datetime
2+ from datetime import datetime , timedelta
33import logging
44import os
55from pathlib import Path
@@ -30,9 +30,11 @@ def test_csv_to_df(self):
3030 logger = TEST_LOGGER ,
3131 )
3232
33- comparison = pd .read_pickle (f"{ self .compare_path } /process_data/main_after_date_SYNEDI_AGG_OUTPATIENT_07022020_1455CDT.pkl" )
34- pd .testing .assert_frame_equal (actual .reset_index (drop = True ), comparison )
35-
33+ columns = list (actual .columns )
34+ expected = pd .read_pickle (f"{ self .compare_path } /process_data/main_after_date_SYNEDI_AGG_OUTPATIENT_07022020_1455CDT.pkl" )
35+ expected .reset_index (drop = True )
36+ expected = expected [columns ]
37+ pd .testing .assert_frame_equal (expected , actual )
3638
3739 def test_write_to_csv (self ):
3840 output_df = pd .read_csv (f"{ self .compare_path } /update_sensor/all.csv" , parse_dates = ["date" ])
@@ -54,7 +56,7 @@ def test_write_to_csv(self):
5456 for f in files :
5557 filename = f .name
5658 actual = pd .read_csv (f )
57- comparison = pd .read_csv (f"{ self .compare_path } /process_data/{ filename } " )
58- pd .testing .assert_frame_equal (actual , comparison )
59+ expected = pd .read_csv (f"{ self .compare_path } /process_data/{ filename } " )
60+ pd .testing .assert_frame_equal (expected , actual )
5961 os .remove (f )
6062
You can’t perform that action at this time.
0 commit comments