Skip to content

Commit

Permalink
fix: back to old version
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpenhaa authored Dec 5, 2023
1 parent d3460d7 commit bd1db15
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/test_dataCleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,32 @@ def test_data_cleaning():
def test_data_cleaning_error():
assert filter_data("test/example.csv") != final_data2


def test_filter_format():
# Test with a CSV file
with tempfile.NamedTemporaryFile(
mode='w',
delete=False,
suffix='.csv'
) as temp:

temp.write("col1,col2\n1,2\n3,4")
temp.seek(0)
result = filter_format(temp.name)
assert isinstance(result, pd.DataFrame)

# Test with a JSON file
with tempfile.NamedTemporaryFile(
mode='w',
delete=False,
suffix='.json'
) as temp:
temp.write('{"col1": [1, 3], "col2": [2, 4]}')
temp.seek(0)
result = filter_format(temp.name)
assert isinstance(result, pd.DataFrame)

# Test with an invalid extension
location = "path/to/invalid/file.invalid"
with pytest.raises(Exception):
filter_format(location)

0 comments on commit bd1db15

Please sign in to comment.