Skip to content

Commit cd83691

Browse files
committed
rewording variable and also ensure that column order is the same
1 parent 9920821 commit cd83691

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

doctor_visits/tests/test_process_data.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Tests for update_sensor.py."""
2-
from datetime import datetime
2+
from datetime import datetime, timedelta
33
import logging
44
import os
55
from 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

0 commit comments

Comments
 (0)