changeset 68:a0328b08e028

tests: open files in binary mode so new lines aren't converted
author Idan Kamara <idankk86@gmail.com>
date Fri, 09 Sep 2011 19:10:02 +0300
parents 730c42743ba3
children e89dd99638ce
files tests/common.py tests/test-import.py tests/test-update.py
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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()
--- 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')
--- 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)