comparison tests/test-log.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
comparison
equal deleted inserted replaced
142:fe74d5599539 143:4359cabcb0cc
1 import common 1 import common
2 import hglib 2 import hglib
3 from hglib.util import b
3 4
4 class test_log(common.basetest): 5 class test_log(common.basetest):
5 def test_basic(self): 6 def test_basic(self):
6 self.append('a', 'a') 7 self.append('a', 'a')
7 rev0, node0 = self.client.commit('first', addremove=True) 8 rev0, node0 = self.client.commit(b('first'), addremove=True)
8 self.append('a', 'a') 9 self.append('a', 'a')
9 rev1, node1 = self.client.commit('second') 10 rev1, node1 = self.client.commit(b('second'))
10 11
11 revs = self.client.log() 12 revs = self.client.log()
12 revs.reverse() 13 revs.reverse()
13 14
14 self.assertTrue(len(revs) == 2) 15 self.assertTrue(len(revs) == 2)
15 self.assertEquals(revs[1].node, node1) 16 self.assertEquals(revs[1].node, node1)
16 17
17 self.assertEquals(revs[0], self.client.log('0')[0]) 18 self.assertEquals(revs[0], self.client.log(b('0'))[0])
18 self.assertEquals(self.client.log(), self.client.log(files=['a'])) 19 self.assertEquals(self.client.log(), self.client.log(files=[b('a')]))
19 20
20 self.assertEquals(self.client.log(), self.client.log(hidden=True)) 21 self.assertEquals(self.client.log(), self.client.log(hidden=True))
21 22
22 # def test_errors(self): 23 # def test_errors(self):
23 # self.assertRaisesRegexp(CommandError, 'abort: unknown revision', 24 # self.assertRaisesRegexp(CommandError, 'abort: unknown revision',