def test_to_csv(tmpdir, request, expected_dir):
    sas_file = request.getfixturevalue(request.param)
    converted_file = Path(tmpdir).joinpath('file1.csv')
    expected_file = expected_dir.joinpath('file1.csv')
    converter.to_csv(sas_file, converted_file)

    assert filecmp.cmp(converted_file, expected_file, shallow=False)
Exemple #2
0
def test_to_csv_path(tmp_path, request, expected_dir):
    sas_file = Path(request.getfixturevalue(request.param))
    converted_file = tmp_path.joinpath("file1.csv")
    expected_file = expected_dir.joinpath("file1.csv")
    converter.to_csv(sas_file, converted_file)

    assert filecmp.cmp(converted_file, expected_file, shallow=False)
def test_to_csv_invalid_extension():
    with pytest.raises(AttributeError) as execinfo:
        converter.to_csv('test.sas7bdat', 'test.bad')

    assert 'sas7bdat conversion error - Valid extension' in str(execinfo.value)
Exemple #4
0
def test_to_csv_invalid_extension():
    with pytest.raises(AttributeError) as execinfo:
        converter.to_csv("test.sas7bdat", "test.bad")

    assert "sas7bdat conversion error - Valid extension" in str(execinfo.value)