diff tests/test-outgoing-incoming.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 46908f4b87d5
children c1b966866ed7
line wrap: on
line diff
--- a/tests/test-outgoing-incoming.py	Sun Mar 08 13:08:37 2015 -0400
+++ b/tests/test-outgoing-incoming.py	Mon Mar 09 18:26:25 2015 -0400
@@ -1,32 +1,34 @@
 import common
 import hglib
+from hglib.util import b
 
 class test_outgoing_incoming(common.basetest):
     def test_no_path(self):
         self.assertRaises(hglib.error.CommandError, self.client.incoming)
 
     def test_empty(self):
-        self.client.clone(dest='other')
-        self.other = hglib.open('other')
+        self.client.clone(dest=b('other'))
+        self.other = hglib.open(b('other'))
 
         self.assertEquals(self.other.incoming(), [])
         self.assertEquals(self.other.outgoing(), [])
 
     def test_basic(self):
         self.append('a', 'a')
-        self.client.commit('first', addremove=True)
+        self.client.commit(b('first'), addremove=True)
         self.append('a', 'a')
-        self.client.commit('second')
+        self.client.commit(b('second'))
 
-        self.client.clone(dest='other')
-        other = hglib.open('other')
+        self.client.clone(dest=b('other'))
+        other = hglib.open(b('other'))
 
         self.assertEquals(self.client.log(), other.log())
-        self.assertEquals(self.client.outgoing(path='other'), other.incoming())
+        self.assertEquals(self.client.outgoing(path=b('other')),
+                          other.incoming())
 
         self.append('a', 'a')
-        rev, node = self.client.commit('third')
-        out = self.client.outgoing(path='other')
+        rev, node = self.client.commit(b('third'))
+        out = self.client.outgoing(path=b('other'))
 
         self.assertEquals(len(out), 1)
         self.assertEquals(out[0].node, node)
@@ -35,17 +37,17 @@
 
     def test_bookmarks(self):
         self.append('a', 'a')
-        self.client.commit('first', addremove=True)
+        self.client.commit(b('first'), addremove=True)
         self.append('a', 'a')
-        self.client.commit('second')
+        self.client.commit(b('second'))
 
-        self.client.clone(dest='other')
-        other = hglib.open('other')
+        self.client.clone(dest=b('other'))
+        other = hglib.open(b('other'))
 
-        self.client.bookmark('bm1', 1)
+        self.client.bookmark(b('bm1'), 1)
 
         self.assertEquals(other.incoming(bookmarks=True),
-                          [('bm1', self.client.tip().node[:12])])
+                          [(b('bm1'), self.client.tip().node[:12])])
 
-        self.assertEquals(self.client.outgoing(path='other', bookmarks=True),
-                          [('bm1', self.client.tip().node[:12])])
+        self.assertEquals(self.client.outgoing(path=b('other'), bookmarks=True),
+                          [(b('bm1'), self.client.tip().node[:12])])