Skip to content

Commit

Permalink
test: added incorrect object passed to saveDataframeCSV and fixed out…
Browse files Browse the repository at this point in the history
…putFilePath error test function call
  • Loading branch information
strixy16 committed Dec 18, 2023
1 parent 69a0d84 commit 281637b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ def test_saveDataframeCSV_outputFilePath_error(nsclcSummaryFilePath):
segType = "SEG")
badFilePath = "notacsv.xlsx"
with pytest.raises(ValueError):
matchCTtoSegmentation(nsclcSummaryFilePath, segType = 'SEG',
outputFilePath = badFilePath)
saveDataframeCSV(testDataframe, badFilePath)

@pytest.mark.parametrize(
"notADataFrame",
[
['list', 'of', 'features'],
"Just a string",
{"feat1": 34, "feat2": 10000, "feat3": 3.141592}
]
)
def test_saveDataframeCSV_dataframe_error(notADataFrame):
"""Check ValueError is raised when something other than pd.DataFrame is passed"""
goodFilePath = "tests/output/badDataframeExample.csv"
with pytest.raises(ValueError):
saveDataframeCSV(notADataFrame, goodFilePath)

0 comments on commit 281637b

Please sign in to comment.