Mercurial > python-hglib
annotate tests/test-resolve.py @ 197:6949fc164439 2.5
hgclient: look for an open server before closing it in ResponseError block
At least some of the codepaths that can throw a ResponseError close
the server first (the one in _readchannel does so in order to detect
server startup failures, for example), so we have to verify we have a
server to close before doing so, otherwise we can lose the
ResponseError and the user sees an AttributeError when we try to use
.close() on a NoneType.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sun, 10 Dec 2017 12:52:37 -0500 |
parents | c1b966866ed7 |
children |
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 | 4 |
5 class test_resolve(common.basetest): | |
6 def setUp(self): | |
7 common.basetest.setUp(self) | |
8 | |
9 self.append('a', 'a') | |
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 | 12 |
13 self.append('a', 'a') | |
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 | 16 |
17 def test_basic(self): | |
18 self.client.update(self.node0) | |
19 self.append('a', 'b') | |
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 | 22 |
134 | 23 self.assertRaises(hglib.error.CommandError, self.client.merge, |
24 self.node1) | |
25 self.assertRaises(hglib.error.CommandError, | |
26 self.client.resolve, all=True) | |
63 | 27 |
143
4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents:
134
diff
changeset
|
28 self.assertEquals([(b('U'), b('a')), (b('U'), b('b'))], |
63 | 29 self.client.resolve(listfiles=True)) |
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) |
4359cabcb0cc
hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents:
134
diff
changeset
|
32 self.assertEquals([(b('R'), b('a')), (b('U'), b('b'))], |
63 | 33 self.client.resolve(listfiles=True)) |