annotate tests/test-manifest.py @ 196:c586d02f7cda

_readchannel: if a read failure is due to a broken server, report that We can end up in this codepath if the specified hg binary fails to start, and we're better off reporting that than the fact that we got no response.
author Augie Fackler <raf@durin42.com>
date Sun, 10 Dec 2017 12:50:57 -0500
parents c1b966866ed7
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, os, stat
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
3 from hglib.util import b
64
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
4
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
5 class test_manifest(common.basetest):
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
6 def test_basic(self):
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
7 self.append('a', 'a')
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
8 files = [b('a')]
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
9 manifest = [(b('047b75c6d7a3ef6a2243bd0e99f94f6ea6683597'), b('644'),
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
10 False, False, b('a'))]
69
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
11
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
12 if os.name == 'posix':
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
13 self.append('b', 'b')
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
14 os.chmod('b', os.stat('b')[0] | stat.S_IEXEC)
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
15 os.symlink('b', 'c')
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
16
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
17 files.extend([b('b'), b('c')])
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
18 manifest.extend([(b('62452855512f5b81522aa3895892760bb8da9f3f'),
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
19 b('755'), True, False, b('b')),
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
20 (b('62452855512f5b81522aa3895892760bb8da9f3f'),
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
21 b('644'), False, True, b('c'))])
69
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
22
143
4359cabcb0cc hglib: move string literals in the test code to util.b() (issue4520)
Brett Cannon <brett@python.org>
parents: 69
diff changeset
23 self.client.commit(b('first'), addremove=True)
64
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
24
69
e89dd99638ce test-manifest: Windows doesn't have symlink or executable bit
Idan Kamara <idankk86@gmail.com>
parents: 64
diff changeset
25 self.assertEquals(list(self.client.manifest(all=True)), files)
64
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
26
a7d98dc798c5 client: add manifest command
Idan Kamara <idankk86@gmail.com>
parents:
diff changeset
27 self.assertEquals(list(self.client.manifest()), manifest)