comparison tests/test_heads.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 fba806958dba
comparison
equal deleted inserted replaced
220:ae6427d1c8f7 221:a2afbf236ca8
1 from tests import common 1 from tests import common
2 from hglib.util import b 2 from hglib.util import b
3 3
4 class test_heads(common.basetest): 4 class test_heads(common.basetest):
5 def test_empty(self): 5 def test_empty(self):
6 self.assertEquals(self.client.heads(), []) 6 self.assertEqual(self.client.heads(), [])
7 7
8 def test_basic(self): 8 def test_basic(self):
9 self.append('a', 'a') 9 self.append('a', 'a')
10 rev, node0 = self.client.commit(b('first'), addremove=True) 10 rev, node0 = self.client.commit(b('first'), addremove=True)
11 self.assertEquals(self.client.heads(), [self.client.tip()]) 11 self.assertEqual(self.client.heads(), [self.client.tip()])
12 12
13 self.client.branch(b('foo')) 13 self.client.branch(b('foo'))
14 self.append('a', 'a') 14 self.append('a', 'a')
15 rev, node1 = self.client.commit(b('second')) 15 rev, node1 = self.client.commit(b('second'))
16 16
17 self.assertEquals(self.client.heads(node0, topological=True), []) 17 self.assertEqual(self.client.heads(node0, topological=True), [])