From d32aaa6bce0eacd5d6ee919a239c7aaad606fc23 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Sun, 2 Jun 2024 22:35:36 -0400 Subject: fixed bug with table loading and made a test case for it --- tests/test_tableflow.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/test_tableflow.py') diff --git a/tests/test_tableflow.py b/tests/test_tableflow.py index 0ab8e76..fce3449 100644 --- a/tests/test_tableflow.py +++ b/tests/test_tableflow.py @@ -26,11 +26,20 @@ def test_table_equality_with_no_output_file_name(): assert not tIn.equals(tOut) def test_table_load_with_in_out_file_names(): + # different filenames, same content for ease of testing tIn,tOut = tblfl.loadInOutTables(inputFileName='tests/tableflow_test_data/tableIn1.csv', outputFileName='tests/tableflow_test_data/tableOut1nonProcessed.csv', comment='#') assert type(tIn) == pd.core.frame.DataFrame assert type(tOut) == pd.core.frame.DataFrame assert tIn.equals(tOut) + # different filenames, different content + tIn,tOut = tblfl.loadInOutTables(inputFileName='tests/tableflow_test_data/tableIn1.csv', outputFileName='tests/tableflow_test_data/tableOut1pariallyProcessed.csv', comment='#') + assert type(tIn) == pd.core.frame.DataFrame + assert type(tOut) == pd.core.frame.DataFrame + assert not tIn.equals(tOut) + assert 'out1' in tOut.columns + assert 'out1' not in tIn.columns + def test_for_existing_row(): tbl1 = pd.DataFrame( {'a':[1,2,3], 'b':[1,4,6]}) r = pd.Series({'a':2, 'b':4}) -- cgit v1.2.3