File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
"""Tests for update_sensor.py."""
2
- from datetime import datetime
2
+ from datetime import datetime , timedelta
3
3
import logging
4
4
import os
5
5
from pathlib import Path
@@ -30,9 +30,11 @@ def test_csv_to_df(self):
30
30
logger = TEST_LOGGER ,
31
31
)
32
32
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 )
36
38
37
39
def test_write_to_csv (self ):
38
40
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):
54
56
for f in files :
55
57
filename = f .name
56
58
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 )
59
61
os .remove (f )
60
62
You can’t perform that action at this time.
0 commit comments