comparison tests/test_branches.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
2 import hglib 2 import hglib
3 from hglib.util import b 3 from hglib.util import b
4 4
5 class test_branches(common.basetest): 5 class test_branches(common.basetest):
6 def test_empty(self): 6 def test_empty(self):
7 self.assertEquals(self.client.branches(), []) 7 self.assertEqual(self.client.branches(), [])
8 8
9 def test_basic(self): 9 def test_basic(self):
10 self.append('a', 'a') 10 self.append('a', 'a')
11 rev0 = self.client.commit(b('first'), addremove=True) 11 rev0 = self.client.commit(b('first'), addremove=True)
12 self.client.branch(b('foo')) 12 self.client.branch(b('foo'))
17 expected = [] 17 expected = []
18 for r, n in (rev1, rev0): 18 for r, n in (rev1, rev0):
19 r = self.client.log(r)[0] 19 r = self.client.log(r)[0]
20 expected.append((r.branch, int(r.rev), r.node[:12])) 20 expected.append((r.branch, int(r.rev), r.node[:12]))
21 21
22 self.assertEquals(branches, expected) 22 self.assertEqual(branches, expected)
23 23
24 def test_active_closed(self): 24 def test_active_closed(self):
25 pass 25 pass