Skip to content

Commit

Permalink
Separated update type option for creating and editing update.
Browse files Browse the repository at this point in the history
fixes #2528

Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
  • Loading branch information
Vismay Golwala authored and mergify[bot] committed Dec 12, 2018
1 parent ee85f95 commit d45a352
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions bodhi/client/__init__.py
Expand Up @@ -93,8 +93,6 @@ def _set_logging_debug(ctx, param, value):
new_edit_options = [
click.option('--user'),
click.option('--password', hide_input=True),
click.option('--type', default='bugfix', help='Update type', required=True,
type=click.Choice(['security', 'bugfix', 'enhancement', 'newpackage'])),
click.option('--severity', help='Update severity',
type=click.Choice(['unspecified', 'low', 'medium', 'high', 'urgent']),
is_eager=True),
Expand Down Expand Up @@ -353,6 +351,8 @@ def require_severity_for_security_update(type, severity):


@updates.command()
@click.option('--type', default='bugfix', help='Update type', required=True,
type=click.Choice(['security', 'bugfix', 'enhancement', 'newpackage']))
@add_options(new_edit_options)
@click.argument('builds')
@click.option('--file', help='A text file containing all the update details')
Expand Down Expand Up @@ -426,6 +426,8 @@ def _validate_edit_update(ctx, param, value):


@updates.command()
@click.option('--type', help='Update type',
type=click.Choice(['security', 'bugfix', 'enhancement', 'newpackage']))
@add_options(new_edit_options)
@click.argument('update', callback=_validate_edit_update)
@url_option
Expand Down
17 changes: 10 additions & 7 deletions bodhi/tests/client/test___init__.py
Expand Up @@ -1420,7 +1420,7 @@ def test_bugs_flag(self, send_request, query):
'autokarma': False, 'edited': 'nodejs-grunt-wrap-0.3.0-2.fc25',
'suggest': 'unspecified', 'notes': 'New package.',
'notes_file': None, 'request': None, 'unstable_karma': -3,
'bugs': '1234,5678', 'requirements': '', 'type': 'bugfix',
'bugs': '1234,5678', 'requirements': '', 'type': 'newpackage',
'severity': 'low'}),
mock.call(
bindings_client,
Expand Down Expand Up @@ -1457,7 +1457,8 @@ def test_severity_flag(self, send_request, query):
'autokarma': False, 'edited': u'nodejs-grunt-wrap-0.3.0-2.fc25',
'suggest': u'unspecified', 'notes': u'Updated package.',
'notes_file': None, 'request': None, 'unstable_karma': -3,
'bugs': '1420605', 'requirements': u'', 'type': 'bugfix', 'severity': u'low'
'bugs': '1420605', 'requirements': u'', 'type': 'newpackage',
'severity': u'low'
}
),
mock.call(
Expand Down Expand Up @@ -1499,7 +1500,8 @@ def test_url_flag(self, send_request, query):
'autokarma': False, 'edited': u'nodejs-grunt-wrap-0.3.0-2.fc25',
'suggest': u'unspecified', 'notes': u'this is an edited note',
'notes_file': None, 'request': None, 'severity': u'low',
'bugs': '1420605', 'requirements': u'', 'unstable_karma': -3, 'type': 'bugfix'
'bugs': '1420605', 'requirements': u'', 'unstable_karma': -3,
'type': 'newpackage'
}
),
mock.call(
Expand Down Expand Up @@ -1547,7 +1549,7 @@ def test_notes_file(self, send_request, query):
'suggest': 'unspecified', 'notes': 'This is a --notes-file note!',
'notes_file': 'notefile.txt', 'request': None, 'severity': 'low',
'bugs': '1420605', 'requirements': u'', 'unstable_karma': -3,
'type': 'bugfix'
'type': 'newpackage'
}
),
mock.call(
Expand Down Expand Up @@ -1605,7 +1607,8 @@ def test_update_title(self, send_request, query):
'autokarma': False, 'edited': u'drupal7-i18n-1.17-1.fc26',
'suggest': u'unspecified', 'notes': u'this is an edited note',
'notes_file': None, 'request': None, 'bugs': '1420605',
'unstable_karma': -3, 'type': 'bugfix', 'severity': u'low', 'requirements': u''
'unstable_karma': -3, 'type': 'newpackage', 'severity': u'low',
'requirements': u''
}
),
mock.call(
Expand Down Expand Up @@ -1698,7 +1701,7 @@ def test_required_tasks(self, send_request, query):
'suggest': u'unspecified', 'notes': u'testing required tasks',
'notes_file': None, 'request': None, 'severity': u'low',
'bugs': '1420605', 'unstable_karma': -3,
'requirements': u'dist.depcheck dist.rpmdeplint', 'type': 'bugfix'
'requirements': u'dist.depcheck dist.rpmdeplint', 'type': 'newpackage'
}
),
mock.call(
Expand Down Expand Up @@ -1757,7 +1760,7 @@ def test_edit_bugless_update_without_bugs_param(self, send_request, query):
'autokarma': False, 'edited': u'nodejs-grunt-wrap-0.3.0-2.fc25',
'suggest': u'unspecified', 'notes': u'New package.',
'notes_file': None, 'request': None, 'severity': u'low',
'bugs': '', 'requirements': u'', 'unstable_karma': -3, 'type': 'bugfix'
'bugs': '', 'requirements': u'', 'unstable_karma': -3, 'type': 'newpackage'
}
),
mock.call(
Expand Down

0 comments on commit d45a352

Please sign in to comment.