comparison tests/test_annotate.py @ 219:8341f2494b3f

hglib tests: migrate away from (unmaintained) nose
author Mathias De Mare <mathias.de_mare@nokia.com>
date Wed, 08 Mar 2023 17:04:58 +0100
parents tests/test-annotate.py@c1b966866ed7
children a2afbf236ca8
comparison
equal deleted inserted replaced
218:934608d4fcba 219:8341f2494b3f
1 from tests import common
2 from hglib.util import b
3
4 class test_annotate(common.basetest):
5 def test_basic(self):
6 self.append('a', 'a\n')
7 rev, node0 = self.client.commit(b('first'), addremove=True)
8 self.append('a', 'a\n')
9 rev, node1 = self.client.commit(b('second'))
10
11 self.assertEquals(list(self.client.annotate(b('a'))),
12 [(b('0'), b('a')), (b('1'), b('a'))])
13 self.assertEquals(list(
14 self.client.annotate(
15 b('a'), user=True, file=True,
16 number=True, changeset=True, line=True, verbose=True)),
17 [(b('test 0 ') + node0[:12] + b(' a:1'), b('a')),
18 (b('test 1 ') + node1[:12] + b(' a:2'), b('a'))])
19
20 def test_files(self):
21 self.append('a', 'a\n')
22 rev, node0 = self.client.commit(b('first'), addremove=True)
23 self.append('b', 'b\n')
24 rev, node1 = self.client.commit(b('second'), addremove=True)
25 self.assertEquals(list(self.client.annotate([b('a'), b('b')])),
26 [(b('0'), b('a')), (b('1'), b('b'))])
27
28 def test_two_colons(self):
29 self.append('a', 'a: b\n')
30 self.client.commit(b('first'), addremove=True)
31 self.assertEquals(list(self.client.annotate(b('a'))),
32 [(b('0'), b('a: b'))])