Mercurial > python-hglib
annotate tests/test-manifest.py @ 194:22767a1e61ac
client: make it robust for weird repository path
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 11 Nov 2017 20:35:55 +0900 |
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, 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 | 4 |
5 class test_manifest(common.basetest): | |
6 def test_basic(self): | |
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 | 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 | 26 |
27 self.assertEquals(list(self.client.manifest()), manifest) |