diff --git a/monascaclient/tests/test_shell.py b/monascaclient/tests/test_shell.py index cd05cfa..dcf478d 100644 --- a/monascaclient/tests/test_shell.py +++ b/monascaclient/tests/test_shell.py @@ -216,6 +216,16 @@ class ShellTestMonascaCommands(ShellBase): retvalue = self.shell(argstr) self.assertRegexpMatches(retvalue, "^Invalid type") + def test_notifications_create_type_sms(self): + self._script_keystone_client() + argstrings = [ + 'notification-create sms1 SMS myphonenumber', + ] + self.m.ReplayAll() + for argstr in argstrings: + retvalue = self.shell(argstr) + self.assertRegexpMatches(retvalue, "^Invalid type") + def test_good_notifications_create_subcommand(self): self._script_keystone_client() diff --git a/monascaclient/v2_0/shell.py b/monascaclient/v2_0/shell.py index ea6ab72..6af0827 100644 --- a/monascaclient/v2_0/shell.py +++ b/monascaclient/v2_0/shell.py @@ -28,7 +28,7 @@ state_types = ['UNDETERMINED', 'ALARM', 'OK'] enabled_types = ['True', 'true', 'False', 'false'] # Notification valid types -notification_types = ['EMAIL', 'SMS'] +notification_types = ['EMAIL'] @utils.arg('name', metavar='', @@ -357,9 +357,9 @@ def do_metric_statistics(mc, args): @utils.arg('name', metavar='', help='Name of the notification to create.') @utils.arg('type', metavar='', - help='The notification type. Type is one of [EMAIL, SMS].') + help='The notification type. Type must be EMAIL.') @utils.arg('address', metavar='
', - help='Depending on the type, a valid EMAIL or SMS Address') + help='A valid EMAIL Address') def do_notification_create(mc, args): '''Create notification.''' if args.type.upper() not in notification_types: @@ -460,9 +460,9 @@ def do_notification_delete(mc, args): @utils.arg('name', metavar='', help='Name of the notification.') @utils.arg('type', metavar='', - help='The notification type. Type is one of [EMAIL, SMS].') + help='The notification type. Type must be EMAIL.') @utils.arg('address', metavar='
', - help='Depending on the type, a valid EMAIL or SMS Address') + help='A valid EMAIL Address') def do_notification_update(mc, args): '''Update notification.''' fields = {}