diff tests/test-import.py @ 143:4359cabcb0cc

hglib: move string literals in the test code to util.b() (issue4520)
author Brett Cannon <brett@python.org>
date Mon, 09 Mar 2015 18:26:25 -0400
parents e738d6fe5f3f
children f3c430afa598
line wrap: on
line diff
--- a/tests/test-import.py	Sun Mar 08 13:08:37 2015 -0400
+++ b/tests/test-import.py	Mon Mar 09 18:26:25 2015 -0400
@@ -1,7 +1,8 @@
 import common, cStringIO, os
 import hglib
+from hglib.util import b
 
-patch = """
+patch = b("""
 # HG changeset patch
 # User test
 # Date 0 0
@@ -14,12 +15,12 @@
 +++ b/a	Thu Jan 01 00:00:00 1970 +0000
 @@ -0,0 +1,1 @@
 +1
-"""
+""")
 
 class test_import(common.basetest):
     def test_basic_cstringio(self):
         self.client.import_(cStringIO.StringIO(patch))
-        self.assertEquals(self.client.cat(['a']), '1\n')
+        self.assertEquals(self.client.cat([b('a')]), b('1\n'))
 
     def test_basic_file(self):
         f = open('patch', 'wb')
@@ -27,11 +28,11 @@
         f.close()
 
         # --no-commit
-        self.client.import_(['patch'], nocommit=True)
+        self.client.import_([b('patch')], nocommit=True)
         self.assertEquals(open('a').read(), '1\n')
 
         self.client.update(clean=True)
         os.remove('a')
 
-        self.client.import_(['patch'])
-        self.assertEquals(self.client.cat(['a']), '1\n')
+        self.client.import_([b('patch')])
+        self.assertEquals(self.client.cat([b('a')]), b('1\n'))