Mercurial > hg-stable
annotate tests/mockblackbox.py @ 49443:2bbd7bc7d6c4
bundle: introduce a --exact option
I have been wanting this options for a long time.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 12 Jul 2022 01:34:18 +0200 |
parents | 6000f5b25c9b |
children | 493034cc3265 |
rev | line source |
---|---|
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
37123
diff
changeset
|
1 from mercurial.utils import procutil |
24705
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
32450
043948c84647
devel: update blackbox to use default-date
Boris Feld <boris.feld@octobus.net>
parents:
28943
diff
changeset
|
3 # 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
|
4 def getuser(): |
36143
f49c3ee5b02f
py3: use b'' in mockblackbox.py
Gregory Szorc <gregory.szorc@gmail.com>
parents:
32450
diff
changeset
|
5 return b'bob' |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
37123
diff
changeset
|
6 |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
37123
diff
changeset
|
7 |
28028
ac49ecb2a897
tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents:
24705
diff
changeset
|
8 def getpid(): |
ac49ecb2a897
tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents:
24705
diff
changeset
|
9 return 5000 |
24705
0ead0a07ed9c
tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
37123
diff
changeset
|
11 |
24705
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): |
37123
a8a902d7176e
procutil: bulk-replace function calls to point to new module
Yuya Nishihara <yuya@tcha.org>
parents:
36143
diff
changeset
|
14 procutil.getuser = getuser |
a8a902d7176e
procutil: bulk-replace function calls to point to new module
Yuya Nishihara <yuya@tcha.org>
parents:
36143
diff
changeset
|
15 procutil.getpid = getpid |