diff --git a/fuelclient/commands/graph.py b/fuelclient/commands/graph.py index 89ee3e9f..8584f3e5 100644 --- a/fuelclient/commands/graph.py +++ b/fuelclient/commands/graph.py @@ -203,7 +203,7 @@ class GraphDownload(base.BaseCommand): def get_parser(self, prog_name): parser = super(GraphDownload, self).get_parser(prog_name) - tasks_level = parser.add_mutually_exclusive_group() + tasks_level = parser.add_mutually_exclusive_group(required=True) parser.add_argument('-e', '--env', type=int, diff --git a/fuelclient/tests/unit/v2/cli/test_deployment_graph.py b/fuelclient/tests/unit/v2/cli/test_deployment_graph.py index 7aabd555..ca3196cd 100644 --- a/fuelclient/tests/unit/v2/cli/test_deployment_graph.py +++ b/fuelclient/tests/unit/v2/cli/test_deployment_graph.py @@ -285,6 +285,13 @@ class TestGraphActions(test_engine.BaseCLITest): ) ) + @mock.patch('sys.stderr') + def test_download_fail(self, mocked_stderr): + cmd = 'graph download --env 1' + self.assertRaises(SystemExit, self.exec_command, cmd) + self.assertIn('-a/--all -c/--cluster -p/--plugins -r/--release', + mocked_stderr.write.call_args_list[-1][0][0]) + def test_list(self): with mock.patch('sys.stdout', new=six.moves.cStringIO()) as m_stdout: self.m_get_client.reset_mock()