annotate tests/test-bookmarks.py @ 58:3d413c54e048

tests: be prepared for basetest.setUp not being called tests might choose to do something else
author Idan Kamara <idankk86@gmail.com>
date Fri, 19 Aug 2011 20:08:13 +0300
parents ca0d7e212cf8
children 5fe53db61aa4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
1 import common
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
2
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
3 class test_bookmarks(common.basetest):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4 def test_empty(self):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 self.assertEquals(self.client.bookmarks(), ([], -1))
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 def test_basic(self):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8 self.append('a', 'a')
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 rev0, node0 = self.client.commit('first', addremove=True)
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.append('a', 'a')
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
11 rev1, node1 = self.client.commit('second')
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 self.client.bookmark('0', rev0)
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.assertEquals(self.client.bookmarks(),
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
15 ([('0', rev0, node0[:12])], -1))
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 self.client.bookmark('1', rev1)
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 self.assertEquals(self.client.bookmarks(),
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 ([('0', rev0, node0[:12]),
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20 ('1', rev1, node1[:12])], 1))
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
21
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22 #def test_spaces(self):
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
23 # self.client.bookmark('s pace', self.rev0)
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24 # self.assertEquals(self.client.bookmarks(),
ca0d7e212cf8 client: add bookmarks command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
25 # ([('s pace', 0, self.rev0.node[:12])], -1))