def test_file_reporter_publish_invalid_csv(tmpdir): tmpdir.chdir() namespace = "data" data = "not a dataframe" reporter = FileReporter(os.getcwd()) with pytest.raises(AttributeError): reporter.publish_csv(namespace, data)
def test_file_reporter_publish_valid_csv(data, tmpdir): tmpdir.chdir() namespace = "data" reporter = FileReporter(os.getcwd()) reporter.publish_csv(namespace, data) loaded_data = pd.read_csv(namespace + ".csv", index_col=0, header=0) assert (loaded_data.values == data.values).all()