Merge "Align required args for 'fuel2 graph upload'"

This commit is contained in:
Jenkins
2016-06-03 16:12:48 +00:00
committed by Gerrit Code Review
2 changed files with 8 additions and 1 deletions

View File

@@ -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',

View File

@@ -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',