From 9524718a91cdcb38a72b6db19df1218e1e5895f1 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Thu, 20 Jun 2019 12:07:22 +0200 Subject: [PATCH] fix tests for CLI --- cli/koji_cli/commands.py | 2 +- tests/test_cli/test_import_cg.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 7c6da2e5..1b657b54 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -1292,7 +1292,7 @@ def handle_import_cg(goptions, session, args): help=_("Do not display progress of the upload")) parser.add_option("--link", action="store_true", help=_("Attempt to hardlink instead of uploading")) parser.add_option("--test", action="store_true", help=_("Don't actually import")) - parser.add_option("--token", action="store", default=None, help=_("Build reservarion token")) + parser.add_option("--token", action="store", default=None, help=_("Build reservation token")) (options, args) = parser.parse_args(args) if len(args) < 2: parser.error(_("Please specify metadata files directory")) diff --git a/tests/test_cli/test_import_cg.py b/tests/test_cli/test_import_cg.py index 3af92489..72eae495 100644 --- a/tests/test_cli/test_import_cg.py +++ b/tests/test_cli/test_import_cg.py @@ -95,7 +95,7 @@ class TestImportCG(utils.CliTestCase): self.assert_console_message(stdout, expected) linked_upload_mock.assert_not_called() session.uploadWrapper.assert_has_calls(calls) - session.CGImport.assert_called_with(metadata, fake_srv_path) + session.CGImport.assert_called_with(metadata, fake_srv_path, None) # Case 2, running in fg, progress off with mock.patch(utils.get_builtin_open()): @@ -105,7 +105,7 @@ class TestImportCG(utils.CliTestCase): self.assert_console_message(stdout, expected) linked_upload_mock.assert_not_called() session.uploadWrapper.assert_has_calls(calls) - session.CGImport.assert_called_with(metadata, fake_srv_path) + session.CGImport.assert_called_with(metadata, fake_srv_path, None) # reset mocks linked_upload_mock.reset_mock() @@ -129,7 +129,7 @@ class TestImportCG(utils.CliTestCase): linked_upload_mock.assert_has_calls(calls) session.uploadWrapper.assert_not_called() - session.CGImport.assert_called_with(metadata, fake_srv_path) + session.CGImport.assert_called_with(metadata, fake_srv_path, None) # make sure there is no message on output self.assert_console_message(stdout, '') @@ -213,10 +213,11 @@ class TestImportCG(utils.CliTestCase): (Specify the --help global option for a list of other help options) Options: - -h, --help show this help message and exit - --noprogress Do not display progress of the upload - --link Attempt to hardlink instead of uploading - --test Don't actually import + -h, --help show this help message and exit + --noprogress Do not display progress of the upload + --link Attempt to hardlink instead of uploading + --test Don't actually import + --token=TOKEN Build reservation token """ % self.progname)