annotate tests/mockblackbox.py @ 34980:705d0f2bb677 stable

pathutil: add doctests for canonpath() This is a followup to f445b10dc7fb. Since there's no way to ensure that more drive letters than C: exist, this seems like the only way to test it. This is enough to catch the f445b10dc7fb scenario, as well as CWD outside of the repo when the path isn't prefixed with path/to/repo.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 03 Nov 2017 22:22:50 -0400
parents 043948c84647
children f49c3ee5b02f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28943
417380aa5bbe py3: use absolute_import in mockblackbox.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28028
diff changeset
1 from __future__ import absolute_import
417380aa5bbe py3: use absolute_import in mockblackbox.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28028
diff changeset
2 from mercurial import (
417380aa5bbe py3: use absolute_import in mockblackbox.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28028
diff changeset
3 util,
417380aa5bbe py3: use absolute_import in mockblackbox.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 28028
diff changeset
4 )
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
5
32412
043948c84647 devel: update blackbox to use default-date
Boris Feld <boris.feld@octobus.net>
parents: 28943
diff changeset
6 # XXX: we should probably offer a devel option to do this in blackbox directly
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
7 def getuser():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
8 return 'bob'
28028
ac49ecb2a897 tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents: 24705
diff changeset
9 def getpid():
ac49ecb2a897 tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents: 24705
diff changeset
10 return 5000
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
11
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
12 # mock the date and user apis so the output is always the same
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
13 def uisetup(ui):
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
14 util.getuser = getuser
28028
ac49ecb2a897 tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents: 24705
diff changeset
15 util.getpid = getpid