def test_file_is_text_does_not_exist(tmpdir): x = tmpdir.join('f') with pytest.raises(ValueError): identify.file_is_text(x.strpath)
def test_file_is_text_simple(tmpdir): x = tmpdir.join('f') x.write_text('hello there\n', encoding='UTF-8') assert identify.file_is_text(x.strpath) is True