Mercurial > public > mercurial-scm > python-hglib
comparison tests/test_status.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 from tests import common | 2 from tests import common |
3 from hglib.util import b | 3 from hglib.util import b |
4 | 4 |
5 class test_status(common.basetest): | 5 class test_status(common.basetest): |
6 def test_empty(self): | 6 def test_empty(self): |
7 self.assertEquals(self.client.status(), []) | 7 self.assertEqual(self.client.status(), []) |
8 | 8 |
9 def test_one_of_each(self): | 9 def test_one_of_each(self): |
10 self.append('.hgignore', 'ignored') | 10 self.append('.hgignore', 'ignored') |
11 self.append('ignored', 'a') | 11 self.append('ignored', 'a') |
12 self.append('clean', 'a') | 12 self.append('clean', 'a') |
38 def test_copy(self): | 38 def test_copy(self): |
39 self.append('source', 'a') | 39 self.append('source', 'a') |
40 self.client.commit(b('first'), addremove=True) | 40 self.client.commit(b('first'), addremove=True) |
41 self.client.copy(b('source'), b('dest')) | 41 self.client.copy(b('source'), b('dest')) |
42 l = [(b('A'), b('dest')), (b(' '), b('source'))] | 42 l = [(b('A'), b('dest')), (b(' '), b('source'))] |
43 self.assertEquals(self.client.status(copies=True), l) | 43 self.assertEqual(self.client.status(copies=True), l) |
44 | 44 |
45 def test_copy_origin_space(self): | 45 def test_copy_origin_space(self): |
46 self.append('s ource', 'a') | 46 self.append('s ource', 'a') |
47 self.client.commit(b('first'), addremove=True) | 47 self.client.commit(b('first'), addremove=True) |
48 self.client.copy(b('s ource'), b('dest')) | 48 self.client.copy(b('s ource'), b('dest')) |
49 l = [(b('A'), b('dest')), (b(' '), b('s ource'))] | 49 l = [(b('A'), b('dest')), (b(' '), b('s ource'))] |
50 self.assertEquals(self.client.status(copies=True), l) | 50 self.assertEqual(self.client.status(copies=True), l) |