Skip to content

Commit 1d86f5d

Browse files
Update test_load_postgres test
Updated comments for clarity in test_load_postgre.py.
1 parent ff3cdd1 commit 1d86f5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_load_postgre.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
def test_load_postgres_success(tmp_path):
88

9-
# 1. Create fake CSV
9+
# Create fake CSV
1010
csv_file = tmp_path / "sample.csv"
1111
csv_file.write_text(
1212
"timestamp_utc,instance,metric_name,original_unit,component_name,component_type,value\n"
1313
"2025-01-01 12:00:00,server1,cpu,%,cpu_component,system,45\n"
1414
)
1515

16-
# 2. Mock engine + conn
16+
# Mock engine + conn
1717
mock_engine = MagicMock()
1818
mock_conn = MagicMock()
1919
mock_engine.begin.return_value.__enter__.return_value = mock_conn
2020

21-
# 3. Fake DataFrames for 5 read_sql calls
21+
# Fake DataFrames
2222
fake_dim_instance = pd.DataFrame({
2323
"instance_id": [1],
2424
"instance_name": ["server1"]
@@ -57,7 +57,7 @@ def test_load_postgres_success(tmp_path):
5757
fake_dim_metric,
5858
fake_dim_component,
5959
fake_dim_date,
60-
fake_fact_export # 5th call for export
60+
fake_fact_export
6161
]
6262

6363
with patch("nifipulse.load_postgres.create_engine", return_value=mock_engine), \

0 commit comments

Comments
 (0)