Kaydet (Commit) 9289bfcf authored tarafından Christian Heimes's avatar Christian Heimes

Fixed test_dumbdbm

The test failed on Windows. I hope the change follows the spirit of the test. On Unix it checks if dumbdbm can handle Windows line separators and on Windows it tests with Unix line separators.
üst 0b48954c
......@@ -113,9 +113,12 @@ class DumbDBMTestCase(unittest.TestCase):
f[b'2'] = b'hello2'
f.close()
# Mangle the file by adding \r before each newline
# Mangle the file by changing the line separator to Windows or Unix
data = io.open(_fname + '.dir', 'rb').read()
data = data.replace(b'\n', b'\r\n')
if os.linesep == b'\n':
data = data.replace(b'\n', b'\r\n')
else:
data = data.replace(b'\r\n', b'\n')
io.open(_fname + '.dir', 'wb').write(data)
f = dumbdbm.open(_fname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment