Fix crlf line endings for double-quote-string-fixer

This commit is contained in:
Anthony Sottile 2019-05-16 09:42:04 -07:00
parent e8e54f7f99
commit 711b730b67
2 changed files with 13 additions and 6 deletions

View file

@ -44,8 +44,15 @@ TESTS = (
@pytest.mark.parametrize(('input_s', 'output', 'expected_retval'), TESTS)
def test_rewrite(input_s, output, expected_retval, tmpdir):
path = tmpdir.join('file.txt')
path = tmpdir.join('file.py')
path.write(input_s)
retval = main([path.strpath])
assert path.read() == output
assert retval == expected_retval
def test_rewrite_crlf(tmpdir):
f = tmpdir.join('f.py')
f.write_binary(b'"foo"\r\n"bar"\r\n')
assert main((f.strpath,))
assert f.read_binary() == b"'foo'\r\n'bar'\r\n"