Mercurial > python-hglib
comparison tests/test_annotate.py @ 221:a2afbf236ca8
hglib tests: remove deprecated constructions
This mostly removes usage of 'assertEquals' (replaced with 'assertEqual'),
as well as opening files without closing them
(fixed using a 'with' statement).
author | Mathias De Mare <mathias.de_mare@nokia.com> |
---|---|
date | Thu, 09 Mar 2023 14:00:02 +0100 |
parents | 8341f2494b3f |
children |
comparison
equal
deleted
inserted
replaced
220:ae6427d1c8f7 | 221:a2afbf236ca8 |
---|---|
6 self.append('a', 'a\n') | 6 self.append('a', 'a\n') |
7 rev, node0 = self.client.commit(b('first'), addremove=True) | 7 rev, node0 = self.client.commit(b('first'), addremove=True) |
8 self.append('a', 'a\n') | 8 self.append('a', 'a\n') |
9 rev, node1 = self.client.commit(b('second')) | 9 rev, node1 = self.client.commit(b('second')) |
10 | 10 |
11 self.assertEquals(list(self.client.annotate(b('a'))), | 11 self.assertEqual(list(self.client.annotate(b('a'))), |
12 [(b('0'), b('a')), (b('1'), b('a'))]) | 12 [(b('0'), b('a')), (b('1'), b('a'))]) |
13 self.assertEquals(list( | 13 self.assertEqual(list( |
14 self.client.annotate( | 14 self.client.annotate( |
15 b('a'), user=True, file=True, | 15 b('a'), user=True, file=True, |
16 number=True, changeset=True, line=True, verbose=True)), | 16 number=True, changeset=True, line=True, verbose=True)), |
17 [(b('test 0 ') + node0[:12] + b(' a:1'), b('a')), | 17 [(b('test 0 ') + node0[:12] + b(' a:1'), b('a')), |
18 (b('test 1 ') + node1[:12] + b(' a:2'), b('a'))]) | 18 (b('test 1 ') + node1[:12] + b(' a:2'), b('a'))]) |
20 def test_files(self): | 20 def test_files(self): |
21 self.append('a', 'a\n') | 21 self.append('a', 'a\n') |
22 rev, node0 = self.client.commit(b('first'), addremove=True) | 22 rev, node0 = self.client.commit(b('first'), addremove=True) |
23 self.append('b', 'b\n') | 23 self.append('b', 'b\n') |
24 rev, node1 = self.client.commit(b('second'), addremove=True) | 24 rev, node1 = self.client.commit(b('second'), addremove=True) |
25 self.assertEquals(list(self.client.annotate([b('a'), b('b')])), | 25 self.assertEqual(list(self.client.annotate([b('a'), b('b')])), |
26 [(b('0'), b('a')), (b('1'), b('b'))]) | 26 [(b('0'), b('a')), (b('1'), b('b'))]) |
27 | 27 |
28 def test_two_colons(self): | 28 def test_two_colons(self): |
29 self.append('a', 'a: b\n') | 29 self.append('a', 'a: b\n') |
30 self.client.commit(b('first'), addremove=True) | 30 self.client.commit(b('first'), addremove=True) |
31 self.assertEquals(list(self.client.annotate(b('a'))), | 31 self.assertEqual(list(self.client.annotate(b('a'))), |
32 [(b('0'), b('a: b'))]) | 32 [(b('0'), b('a: b'))]) |