annotate tests/test_resolve.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
148
c1b966866ed7 hglib: make all imports absolute (issue4520)
Brett Cannon <brett@python.org>
parents: 143
diff changeset
1 from tests import common
c1b966866ed7 hglib: make all imports absolute (issue4520)
Brett Cannon <brett@python.org>
parents: 143
diff changeset
2 import hglib
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
3 from hglib.util import b
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 class test_resolve(common.basetest):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 def setUp(self):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 common.basetest.setUp(self)
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
8
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
9 self.append('a', 'a')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
10 self.append('b', 'b')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
11 rev, self.node0 = self.client.commit(b('first'), addremove=True)
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
12
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
13 self.append('a', 'a')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
14 self.append('b', 'b')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
15 rev, self.node1 = self.client.commit(b('second'))
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
16
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
17 def test_basic(self):
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
18 self.client.update(self.node0)
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
19 self.append('a', 'b')
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
20 self.append('b', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
21 rev, self.node3 = self.client.commit(b('third'))
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
22
134
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
23 self.assertRaises(hglib.error.CommandError, self.client.merge,
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
24 self.node1)
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
25 self.assertRaises(hglib.error.CommandError,
1b47146a4a2c style: fix long lines
Matt Mackall <mpm@selenic.com>
parents: 63
diff changeset
26 self.client.resolve, all=True)
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27
221
a2afbf236ca8 hglib tests: remove deprecated constructions
Mathias De Mare <mathias.de_mare@nokia.com>
parents: 219
diff changeset
28 self.assertEqual([(b('U'), b('a')), (b('U'), b('b'))],
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
29 self.client.resolve(listfiles=True))
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
30
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 134
diff changeset
31 self.client.resolve(b('a'), mark=True)
221
a2afbf236ca8 hglib tests: remove deprecated constructions
Mathias De Mare <mathias.de_mare@nokia.com>
parents: 219
diff changeset
32 self.assertEqual([(b('R'), b('a')), (b('U'), b('b'))],
63
939d1d763bb1 client: add resolve command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
33 self.client.resolve(listfiles=True))