mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 14:01:57 -09:00
utils/get-developers: use parser.error() rather than canned print+return
parser.error() reports a nice error message, that also displays a short reminder of the available options. Adapt the test-suite accordingly: previously, the error string was an exact string in the stdout list, while it now is a substring in one of the strings in stderr. The exit code changes, too. Signed-off-by: Yann E. MORIN <yann.morin@orange.com> Cc: Julien Olivain <ju.o@free.fr> Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
committed by
Julien Olivain
parent
cdcb3f56e8
commit
35f381b93e
@@ -41,9 +41,9 @@ class TestGetDevelopers(unittest.TestCase):
|
||||
# no args, with syntax error in the file
|
||||
developers = b'text3\n'
|
||||
out, err, rc = call_get_developers("./utils/get-developers", [], self.WITH_EMPTY_PATH, topdir, developers)
|
||||
self.assertIn("No action specified", out)
|
||||
self.assertEqual(rc, 0)
|
||||
self.assertEqual(len(err), 0)
|
||||
self.assertIn("No action specified", "\n".join(err))
|
||||
self.assertEqual(rc, 2)
|
||||
self.assertEqual(len(out), 0)
|
||||
|
||||
# -v generating error, called from the main dir
|
||||
developers = b'text1\n'
|
||||
@@ -150,9 +150,9 @@ class TestGetDevelopers(unittest.TestCase):
|
||||
# no args, with syntax error in the file
|
||||
developers = b'text3\n'
|
||||
out, err, rc = call_get_developers("./utils/get-developers", [], self.WITH_EMPTY_PATH, topdir, developers)
|
||||
self.assertIn("No action specified", out)
|
||||
self.assertEqual(rc, 0)
|
||||
self.assertEqual(len(err), 0)
|
||||
self.assertIn("No action specified", "\n".join(err))
|
||||
self.assertEqual(rc, 2)
|
||||
self.assertEqual(len(out), 0)
|
||||
|
||||
# patchfile from topdir and from elsewhere
|
||||
abs_path = infra.filepath("tests/utils/test_get_developers/")
|
||||
|
||||
Reference in New Issue
Block a user