Mercurial > hg
comparison tests/test-phabricator.t @ 44436:09f3e003fc2a
phabricator: avoid a stacktrace when command arguments are missing
Previously, the TypeError wasn't properly converted to a SignatureError when
improper arguments were supplied to the inner function, because the stack depth
is 2 inside the vcrcommand decorator. The `__name__` and `__doc__` attributes
need to be reassigned to the new wrapper so that the help summary is available.
Differential Revision: https://phab.mercurial-scm.org/D8209
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Mar 2020 00:45:54 -0500 |
parents | d1177d39012e |
children | bbb170f9396d |
comparison
equal
deleted
inserted
replaced
44435:4152183acedd | 44436:09f3e003fc2a |
---|---|
26 above config and have a real token in the test but not have to edit | 26 above config and have a real token in the test but not have to edit |
27 this test. | 27 this test. |
28 $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \ | 28 $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \ |
29 > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head | 29 > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head |
30 abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long. | 30 abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long. |
31 | |
32 Missing arguments print the command help | |
33 | |
34 $ hg phabread | |
35 hg phabread: invalid arguments | |
36 hg phabread DREVSPEC [OPTIONS] | |
37 | |
38 print patches from Phabricator suitable for importing | |
39 | |
40 options: | |
41 | |
42 --stack read dependencies | |
43 | |
44 (use 'hg phabread -h' to show more help) | |
45 [255] | |
31 | 46 |
32 Basic phabread: | 47 Basic phabread: |
33 $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head | 48 $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head |
34 # HG changeset patch | 49 # HG changeset patch |
35 # Date 1536771503 0 | 50 # Date 1536771503 0 |