)]}'
{"glanceclient/shell.py":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"2b7dcb7bccd4fafa384a000d2e7c6ff992e117da","unresolved":false,"context_lines":[{"line_number":717,"context_line":"               help\u003d\u0027Display help for \u003csubcommand\u003e.\u0027)"},{"line_number":718,"context_line":"    def do_help(self, args, parser):"},{"line_number":719,"context_line":"        \"\"\"Display help about this program or one of its subcommands.\"\"\""},{"line_number":720,"context_line":"        command \u003d getattr(args, \u0027command\u0027, \u0027\u0027)"},{"line_number":721,"context_line":""},{"line_number":722,"context_line":"        if command:"},{"line_number":723,"context_line":"            if args.command in self.subcommands:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_66f27b08","line":720,"updated":"2015-09-10 11:05:27.000000000","message":"previously this was:\n\nif getattr(args, \u0027command\u0027, None)\n\ndoesn\u0027t really matter, but None may be slightly more pythonic","commit_id":"4944c07495010b68c4bc0547f2f548f45a45f63a"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"c4caf48eff6b4ed151fe2505b095febf21060614","unresolved":false,"context_lines":[{"line_number":730,"context_line":""},{"line_number":731,"context_line":"        if not args.os_image_api_version or args.os_image_api_version \u003d\u003d \u00272\u0027:"},{"line_number":732,"context_line":"            print()"},{"line_number":733,"context_line":"            print((\"Run `glance --os-image-api-version 1 help%s` \""},{"line_number":734,"context_line":"                   \"for v1 help\") % (\u0027 \u0027 + command))"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    def do_bash_completion(self, _args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_e619ab23","line":733,"updated":"2015-09-10 11:10:33.000000000","message":"Stuart, The empty string makes more sense here than None.","commit_id":"4944c07495010b68c4bc0547f2f548f45a45f63a"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"520146e8fd89d0fab8eb4b331fa73b02fc254d24","unresolved":false,"context_lines":[{"line_number":729,"context_line":"            parser.print_help()"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"        if not args.os_image_api_version or args.os_image_api_version \u003d\u003d \u00272\u0027:"},{"line_number":732,"context_line":"            print()"},{"line_number":733,"context_line":"            print((\"Run `glance --os-image-api-version 1 help%s` \""},{"line_number":734,"context_line":"                   \"for v1 help\") % (\u0027 \u0027 + command))"},{"line_number":735,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_fabdbc02","line":732,"updated":"2015-09-10 12:54:46.000000000","message":"nit: we\u0027ll have a stray space between help and the ` if there is no command.\n\nSetting command to None above and handling that would be one possible way to toggle displaying the space.\n\nIt would also make the unit tests pass I think.","commit_id":"88d82fa52a53c2492349e66c03f1203b2955a985"}],"glanceclient/tests/unit/test_shell.py":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c59b083f2b955d3cec8b2e41c0fa6561acbc8f26","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            self.assertEqual(0, actual)"},{"line_number":159,"context_line":"            self.assertFalse(et_mock.called)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_blanc_call(self):"},{"line_number":162,"context_line":"        shell \u003d openstack_shell.OpenStackImagesShell()"},{"line_number":163,"context_line":"        with mock.patch.object(shell, \u0027_get_endpoint_and_token\u0027) as et_mock:"},{"line_number":164,"context_line":"            actual \u003d shell.main(\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_c0d3fd36","line":161,"updated":"2015-09-11 12:07:20.000000000","message":"typo? (blanc)","commit_id":"70d2dee6a1a43fa587f98b93d48da5be0ad33a09"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"0c737129fc7f34c83a0a1ca704022db0a136b23a","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            self.assertEqual(0, actual)"},{"line_number":159,"context_line":"            self.assertFalse(et_mock.called)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_blanc_call(self):"},{"line_number":162,"context_line":"        shell \u003d openstack_shell.OpenStackImagesShell()"},{"line_number":163,"context_line":"        with mock.patch.object(shell, \u0027_get_endpoint_and_token\u0027) as et_mock:"},{"line_number":164,"context_line":"            actual \u003d shell.main(\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_f6c4cb60","line":161,"in_reply_to":"da20952f_c0d3fd36","updated":"2015-09-11 12:59:23.000000000","message":"Yup, too little coffee ;)","commit_id":"70d2dee6a1a43fa587f98b93d48da5be0ad33a09"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c59b083f2b955d3cec8b2e41c0fa6561acbc8f26","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        with mock.patch.object(shell, \u0027_get_endpoint_and_token\u0027) as et_mock:"},{"line_number":164,"context_line":"            actual \u003d shell.main(\u0027\u0027)"},{"line_number":165,"context_line":"            self.assertEqual(0, actual)"},{"line_number":166,"context_line":"            self.assertFalse(et_mock.called)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_help_on_subcommand_error(self):"},{"line_number":169,"context_line":"        self.assertRaises(exc.CommandError, shell,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_a0ffe964","line":166,"updated":"2015-09-11 12:07:20.000000000","message":"we could consider a functional test(s) also, eg compare the \u0027test_help\u0027 test in ./glanceclient/tests/functional/test_readonly_glance.py\n\ntesting \u0027glance\u0027 \u0027glance help\u0027 and \u0027glance --help\u0027 might make sense.","commit_id":"70d2dee6a1a43fa587f98b93d48da5be0ad33a09"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"0c737129fc7f34c83a0a1ca704022db0a136b23a","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        with mock.patch.object(shell, \u0027_get_endpoint_and_token\u0027) as et_mock:"},{"line_number":164,"context_line":"            actual \u003d shell.main(\u0027\u0027)"},{"line_number":165,"context_line":"            self.assertEqual(0, actual)"},{"line_number":166,"context_line":"            self.assertFalse(et_mock.called)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_help_on_subcommand_error(self):"},{"line_number":169,"context_line":"        self.assertRaises(exc.CommandError, shell,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_d68d0732","line":166,"in_reply_to":"da20952f_a0ffe964","updated":"2015-09-11 12:59:23.000000000","message":"I think that\u0027s not bad idea, but perhaps not in a scope for this test. Some rationalizing in our tests wouldn\u0027t be bad.","commit_id":"70d2dee6a1a43fa587f98b93d48da5be0ad33a09"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"961d2fe7052064c8cd2dbec3ef48b4fced6f84d0","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        with mock.patch.object(shell, \u0027_get_endpoint_and_token\u0027) as et_mock:"},{"line_number":164,"context_line":"            actual \u003d shell.main(\u0027\u0027)"},{"line_number":165,"context_line":"            self.assertEqual(0, actual)"},{"line_number":166,"context_line":"            self.assertFalse(et_mock.called)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_help_on_subcommand_error(self):"},{"line_number":169,"context_line":"        self.assertRaises(exc.CommandError, shell,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_76cd1b2f","line":166,"in_reply_to":"da20952f_d68d0732","updated":"2015-09-11 13:06:15.000000000","message":"Not sure why something which tests this fix is considered out of scope.\n\nFWIW here\u0027s what the test would look like (basically cut + paste the test_help):\n\n    def test_blank_call(self):\n        help_text \u003d self.glance(\u0027\u0027)\n        lines \u003d help_text.split(\u0027\\n\u0027)\n        self.assertFirstLineStartsWith(lines, \u0027usage: glance\u0027)\n\n        commands \u003d []\n        cmds_start \u003d lines.index(\u0027Positional arguments:\u0027)\n        cmds_end \u003d lines.index(\u0027Optional arguments:\u0027)\n        command_pattern \u003d re.compile(\u0027^ {4}([a-z0-9\\-\\_]+)\u0027)\n        for line in lines[cmds_start:cmds_end]:\n            match \u003d command_pattern.match(line)\n            if match:\n                commands.append(match.group(1))\n        commands \u003d set(commands)\n        wanted_commands \u003d set((\u0027image-create\u0027, \u0027image-delete\u0027, \u0027help\u0027,\n                               \u0027image-download\u0027, \u0027image-show\u0027, \u0027image-update\u0027,\n                               \u0027member-create\u0027, \u0027member-delete\u0027,\n                               \u0027member-list\u0027, \u0027image-list\u0027))\n        self.assertFalse(wanted_commands - commands)","commit_id":"70d2dee6a1a43fa587f98b93d48da5be0ad33a09"}]}
