From 8d2aad0cfa3ab5341ca8cbecbaee3d8709990e47 Mon Sep 17 00:00:00 2001 From: Jana Cupova Date: Jun 14 2022 09:59:14 +0000 Subject: CLI: download-task prints "No files for download found." to stdout Fixes: https://pagure.io/koji/issue/3400 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 42213c3..d1a4612 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -7393,7 +7393,8 @@ def anon_handle_download_task(options, session, args): downloads.append((task, filename, volume, new_filename)) if len(downloads) == 0: - error("No files for download found.") + print("No files for download found.") + return required_tasks = {} for (task, nop, nop, nop) in downloads: diff --git a/tests/test_cli/test_download_task.py b/tests/test_cli/test_download_task.py index e4d0362..64d0a23 100644 --- a/tests/test_cli/test_download_task.py +++ b/tests/test_cli/test_download_task.py @@ -215,15 +215,13 @@ class TestDownloadTask(utils.CliTestCase): # Run it and check immediate output # args: task_id --arch=s390,ppc - # expected: failure - with self.assertRaises(SystemExit) as ex: - anon_handle_download_task(self.options, self.session, args) - self.assertExitCode(ex, 1) + # expected: pass + anon_handle_download_task(self.options, self.session, args) actual = self.stdout.getvalue() - expected = '' + expected = 'No files for download found.\n' self.assertMultiLineEqual(actual, expected) actual = self.stderr.getvalue() - expected = 'No files for download found.\n' + expected = '' self.assertMultiLineEqual(actual, expected) # Finally, assert that things were called as we expected. self.ensure_connection.assert_called_once_with(self.session, self.options)