# HG changeset patch # User Idan Kamara # Date 1315584602 -10800 # Node ID a0328b08e02822525c0e1fab12c18acc7991a70b # Parent 730c42743ba31689c0c5772da7515c4c9184d334 tests: open files in binary mode so new lines aren't converted diff -r 730c42743ba3 -r a0328b08e028 tests/common.py --- a/tests/common.py Mon Sep 05 20:51:29 2011 +0300 +++ b/tests/common.py Fri Sep 09 19:10:02 2011 +0300 @@ -41,7 +41,7 @@ pass # if our setUp was overriden def append(self, path, *args): - f = open(path, 'a') + f = open(path, 'ab') for a in args: f.write(str(a)) f.close() diff -r 730c42743ba3 -r a0328b08e028 tests/test-import.py --- a/tests/test-import.py Mon Sep 05 20:51:29 2011 +0300 +++ b/tests/test-import.py Fri Sep 09 19:10:02 2011 +0300 @@ -22,6 +22,6 @@ self.assertEquals(self.client.cat(['a']), '1\n') def test_basic_file(self): - open('patch', 'w').write(patch) + open('patch', 'wb').write(patch) self.client.import_(['patch']) self.assertEquals(self.client.cat(['a']), '1\n') diff -r 730c42743ba3 -r a0328b08e028 tests/test-update.py --- a/tests/test-update.py Mon Sep 05 20:51:29 2011 +0300 +++ b/tests/test-update.py Fri Sep 09 19:10:02 2011 +0300 @@ -33,7 +33,7 @@ self.client.commit('fourth') self.client.update(rev2) old = open('a').read() - open('a', 'w').write('a' + old) + open('a', 'wb').write('a' + old) u, m, r, ur = self.client.update() self.assertEquals(u, 0) self.assertEquals(m, 1)