diff --git a/fuelclient/commands/graph.py b/fuelclient/commands/graph.py index 32eacac..5f6ec40 100644 --- a/fuelclient/commands/graph.py +++ b/fuelclient/commands/graph.py @@ -59,7 +59,7 @@ class GraphUpload(base.BaseCommand, FileMethodsMixin): def get_parser(self, prog_name): parser = super(GraphUpload, self).get_parser(prog_name) - graph_class = parser.add_mutually_exclusive_group() + graph_class = parser.add_mutually_exclusive_group(required=True) graph_class.add_argument('-e', '--env', diff --git a/fuelclient/tests/unit/v2/cli/test_deployment_graph.py b/fuelclient/tests/unit/v2/cli/test_deployment_graph.py index 1c5e272..4d7b53e 100644 --- a/fuelclient/tests/unit/v2/cli/test_deployment_graph.py +++ b/fuelclient/tests/unit/v2/cli/test_deployment_graph.py @@ -77,6 +77,13 @@ class TestGraphActions(test_engine.BaseCLITest): ) ) + @mock.patch('sys.stderr') + def test_upload_fail(self, mocked_stderr): + cmd = 'graph upload --file new_graph.yaml' + self.assertRaises(SystemExit, self.exec_command, cmd) + self.assertIn('-e/--env -r/--release -p/--plugin', + mocked_stderr.write.call_args_list[-1][0][0]) + def test_execute(self): self._test_cmd( 'execute',