Mercurial > public > mercurial-scm > python-hglib
comparison tests/test_outgoing_incoming.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 |
---|---|
8 | 8 |
9 def test_empty(self): | 9 def test_empty(self): |
10 self.client.clone(dest=b('other')) | 10 self.client.clone(dest=b('other')) |
11 self.other = hglib.open(b('other')) | 11 self.other = hglib.open(b('other')) |
12 | 12 |
13 self.assertEquals(self.other.incoming(), []) | 13 self.assertEqual(self.other.incoming(), []) |
14 self.assertEquals(self.other.outgoing(), []) | 14 self.assertEqual(self.other.outgoing(), []) |
15 | 15 |
16 def test_basic(self): | 16 def test_basic(self): |
17 self.append('a', 'a') | 17 self.append('a', 'a') |
18 self.client.commit(b('first'), addremove=True) | 18 self.client.commit(b('first'), addremove=True) |
19 self.append('a', 'a') | 19 self.append('a', 'a') |
20 self.client.commit(b('second')) | 20 self.client.commit(b('second')) |
21 | 21 |
22 self.client.clone(dest=b('other')) | 22 self.client.clone(dest=b('other')) |
23 other = hglib.open(b('other')) | 23 other = hglib.open(b('other')) |
24 | 24 |
25 self.assertEquals(self.client.log(), other.log()) | 25 self.assertEqual(self.client.log(), other.log()) |
26 self.assertEquals(self.client.outgoing(path=b('other')), | 26 self.assertEqual(self.client.outgoing(path=b('other')), |
27 other.incoming()) | 27 other.incoming()) |
28 | 28 |
29 self.append('a', 'a') | 29 self.append('a', 'a') |
30 rev, node = self.client.commit(b('third')) | 30 rev, node = self.client.commit(b('third')) |
31 out = self.client.outgoing(path=b('other')) | 31 out = self.client.outgoing(path=b('other')) |
32 | 32 |
33 self.assertEquals(len(out), 1) | 33 self.assertEqual(len(out), 1) |
34 self.assertEquals(out[0].node, node) | 34 self.assertEqual(out[0].node, node) |
35 | 35 |
36 self.assertEquals(out, other.incoming()) | 36 self.assertEqual(out, other.incoming()) |
37 | 37 |
38 def test_bookmarks(self): | 38 def test_bookmarks(self): |
39 self.append('a', 'a') | 39 self.append('a', 'a') |
40 self.client.commit(b('first'), addremove=True) | 40 self.client.commit(b('first'), addremove=True) |
41 self.append('a', 'a') | 41 self.append('a', 'a') |
44 self.client.clone(dest=b('other')) | 44 self.client.clone(dest=b('other')) |
45 other = hglib.open(b('other')) | 45 other = hglib.open(b('other')) |
46 | 46 |
47 self.client.bookmark(b('bm1'), 1) | 47 self.client.bookmark(b('bm1'), 1) |
48 | 48 |
49 self.assertEquals(other.incoming(bookmarks=True), | 49 self.assertEqual(other.incoming(bookmarks=True), |
50 [(b('bm1'), self.client.tip().node[:12])]) | 50 [(b('bm1'), self.client.tip().node[:12])]) |
51 | 51 |
52 self.assertEquals(self.client.outgoing(path=b('other'), bookmarks=True), | 52 self.assertEqual(self.client.outgoing(path=b('other'), bookmarks=True), |
53 [(b('bm1'), self.client.tip().node[:12])]) | 53 [(b('bm1'), self.client.tip().node[:12])]) |