diff tests/test-hidden.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 1b47146a4a2c
children c1b966866ed7
line wrap: on
line diff
--- a/tests/test-hidden.py	Sun Mar 08 13:08:37 2015 -0400
+++ b/tests/test-hidden.py	Mon Mar 09 18:26:25 2015 -0400
@@ -1,5 +1,6 @@
 import common, hglib, datetime
 from hglib.error import CommandError
+from hglib.util import b
 
 class test_obsolete_reference(common.basetest):
     """make sure obsolete changesets are disabled"""
@@ -7,10 +8,10 @@
         f = open('gna1','w')
         f.write('g')
         f.close()
-        self.client.add('gna1')
-        cs = self.client.commit('gna1')[1] #get id
+        self.client.add(b('gna1'))
+        cs = self.client.commit(b('gna1'))[1] #get id
         self.assertRaises(CommandError,
-                          self.client.rawcommand, ['debugobsolete', cs])
+                          self.client.rawcommand, [b('debugobsolete'), cs])
 
 
 class test_obsolete_baselib(common.basetest):
@@ -28,21 +29,21 @@
     def test_debugobsolete_success(self):
         """check the obsolete extension is available"""
         self.append('gna1','ga')
-        self.client.add('gna1')
-        cs = self.client.commit('gna1')[1] #get id
-        self.client.rawcommand(['debugobsolete', cs])
+        self.client.add(b('gna1'))
+        cs = self.client.commit(b('gna1'))[1] #get id
+        self.client.rawcommand([b('debugobsolete'), cs])
 
     def test_obsolete_in(self):
         """test the 'hidden' keyword with the 'in' method"""
         if self.client.version < (2, 9, 0):
             return
         self.append('gna1','ga')
-        self.client.add('gna1')
-        cs0 = self.client.commit('gna1')[1] #get id
+        self.client.add(b('gna1'))
+        cs0 = self.client.commit(b('gna1'))[1] #get id
         self.append('gna2','gaaa')
-        self.client.add('gna2')
-        cs1 = self.client.commit('gna2')[1] #get id
-        self.client.rawcommand(['debugobsolete', cs1])
+        self.client.add(b('gna2'))
+        cs1 = self.client.commit(b('gna2'))[1] #get id
+        self.client.rawcommand([b('debugobsolete'), cs1])
         self.client.update(cs0)
         self.assertFalse(cs1 in self.client)
         self.assertTrue(cs0 in self.client)
@@ -56,16 +57,14 @@
         if self.client.version < (2, 9, 0):
             return
         self.append('gna1','ga')
-        self.client.add('gna1')
-        cs0 = self.client.commit('gna1')[1] #get id
+        self.client.add(b('gna1'))
+        cs0 = self.client.commit(b('gna1'))[1] #get id
         ctx0 = self.client[cs0]
         self.append('gna2','gaaa')
-        self.client.add('gna2')
-        cs1 = self.client.commit('gna2')[1] #get id
+        self.client.add(b('gna2'))
+        cs1 = self.client.commit(b('gna2'))[1] #get id
         ctx1 = self.client[cs1]
-        self.client.rawcommand(['debugobsolete', cs1])
+        self.client.rawcommand([b('debugobsolete'), cs1])
         self.client.update(cs0)
         self.assertTrue(ctx1.hidden())
         self.assertFalse(ctx0.hidden())
-
-