Mercurial > python-hglib
comparison tests/test-bookmarks.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 | 2e2055fc66c3 |
children | c1b966866ed7 |
comparison
equal
deleted
inserted
replaced
142:fe74d5599539 | 143:4359cabcb0cc |
---|---|
1 import common | 1 import common |
2 from hglib.util import b | |
2 | 3 |
3 class test_bookmarks(common.basetest): | 4 class test_bookmarks(common.basetest): |
4 def test_empty(self): | 5 def test_empty(self): |
5 self.assertEquals(self.client.bookmarks(), ([], -1)) | 6 self.assertEquals(self.client.bookmarks(), ([], -1)) |
6 | 7 |
7 def test_basic(self): | 8 def test_basic(self): |
8 self.append('a', 'a') | 9 self.append('a', 'a') |
9 rev0, node0 = self.client.commit('first', addremove=True) | 10 rev0, node0 = self.client.commit(b('first'), addremove=True) |
10 self.append('a', 'a') | 11 self.append('a', 'a') |
11 rev1, node1 = self.client.commit('second') | 12 rev1, node1 = self.client.commit(b('second')) |
12 | 13 |
13 self.client.bookmark('zero', rev0) | 14 self.client.bookmark(b('zero'), rev0) |
14 self.assertEquals(self.client.bookmarks(), | 15 self.assertEquals(self.client.bookmarks(), |
15 ([('zero', rev0, node0[:12])], -1)) | 16 ([(b('zero'), rev0, node0[:12])], -1)) |
16 | 17 |
17 self.client.bookmark('one', rev1) | 18 self.client.bookmark(b('one'), rev1) |
18 self.assertEquals(self.client.bookmarks()[0], | 19 self.assertEquals(self.client.bookmarks()[0], |
19 [('one', rev1, node1[:12]), | 20 [(b('one'), rev1, node1[:12]), |
20 ('zero', rev0, node0[:12])]) | 21 (b('zero'), rev0, node0[:12])]) |
21 | 22 |
22 #def test_spaces(self): | 23 #def test_spaces(self): |
23 # self.client.bookmark('s pace', self.rev0) | 24 # self.client.bookmark('s pace', self.rev0) |
24 # self.assertEquals(self.client.bookmarks(), | 25 # self.assertEquals(self.client.bookmarks(), |
25 # ([('s pace', 0, self.rev0.node[:12])], -1)) | 26 # ([('s pace', 0, self.rev0.node[:12])], -1)) |