)]}'
{"glanceclient/shell.py":[{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"64f4d657d75bb5211972de6cfa74999e324c2d46","unresolved":false,"context_lines":[{"line_number":612,"context_line":"        try:"},{"line_number":613,"context_line":"            subcommand_parser \u003d self.get_subcommand_parser(api_version)"},{"line_number":614,"context_line":"        except Exception:"},{"line_number":615,"context_line":"            if options.debug is True:"},{"line_number":616,"context_line":"                traceback.print_exc()"},{"line_number":617,"context_line":"            raise"},{"line_number":618,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_412300be","line":615,"updated":"2015-04-07 14:45:55.000000000","message":"Wouldn\u0027t `if options.debug:` be enough?","commit_id":"a78bbf1d5b4f75f23cf6f7a86ee2f43bb84783ea"}],"tests/test_shell.py":[{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"64f4d657d75bb5211972de6cfa74999e324c2d46","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from requests_mock.contrib import fixture as rm_fixture"},{"line_number":28,"context_line":"import six"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"from glanceclient.common.utils import exit as utils_exit"},{"line_number":31,"context_line":"from glanceclient import exc"},{"line_number":32,"context_line":"from glanceclient import shell as openstack_shell"},{"line_number":33,"context_line":"from glanceclient.shell import SUPPORTED_VERSIONS"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_5cb1a38e","line":30,"updated":"2015-04-07 14:45:55.000000000","message":"We should avoid importing objects, just modules.","commit_id":"a78bbf1d5b4f75f23cf6f7a86ee2f43bb84783ea"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"64f4d657d75bb5211972de6cfa74999e324c2d46","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from glanceclient.common.utils import exit as utils_exit"},{"line_number":31,"context_line":"from glanceclient import exc"},{"line_number":32,"context_line":"from glanceclient import shell as openstack_shell"},{"line_number":33,"context_line":"from glanceclient.shell import SUPPORTED_VERSIONS"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"#NOTE (esheffield) Used for the schema caching tests"},{"line_number":36,"context_line":"from glanceclient.v2 import schemas as schemas"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_9c5a8b82","line":33,"updated":"2015-04-07 14:45:55.000000000","message":"You could simply operate on openstack_shell.SUPPORTED_VERSIONS instead of importing it explicitly.","commit_id":"a78bbf1d5b4f75f23cf6f7a86ee2f43bb84783ea"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"31997b15ae7d3f903148901f92bec2ec145f1548","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        except ImportError as e:"},{"line_number":352,"context_line":"            if str(e) !\u003d msg:"},{"line_number":353,"context_line":"                self.fail(\"Unexpected import error message: \""},{"line_number":354,"context_line":"                          \"\u0027%s\u0027, expected \u0027%s\u0027\" % (e.message, msg))"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    @mock.patch.object(openstack_shell.OpenStackImagesShell,"},{"line_number":357,"context_line":"                       \u0027get_subcommand_parser\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aa745d1_01f62e8f","line":354,"updated":"2015-04-16 13:54:53.000000000","message":"nit (#protip): Such cases could be easily handled using assertRaises to minimize the code, such as:\n\n msg \u003d \u0027Unable to import module. Re-run with --debug for more info.\u0027\n e \u003d self.assertRaises(ImportError, shell.main, argstr.split())\n self.assertEqual(msg, str(e))\n\n\nAdditionally the messages for failed assertion could be also provided.","commit_id":"ae69e02b29e9667fa41ac4fb2828e9d74a97fe3c"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"095d7c2da77e1168a66002df20c726253a740eb6","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        except ImportError as e:"},{"line_number":352,"context_line":"            if str(e) !\u003d msg:"},{"line_number":353,"context_line":"                self.fail(\"Unexpected import error message: \""},{"line_number":354,"context_line":"                          \"\u0027%s\u0027, expected \u0027%s\u0027\" % (e.message, msg))"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    @mock.patch.object(openstack_shell.OpenStackImagesShell,"},{"line_number":357,"context_line":"                       \u0027get_subcommand_parser\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aa745d1_4411e4ab","line":354,"in_reply_to":"5aa745d1_01f62e8f","updated":"2015-04-16 14:06:39.000000000","message":"That\u0027s what I usually do! Thanks, it\u0027s cleaner.","commit_id":"ae69e02b29e9667fa41ac4fb2828e9d74a97fe3c"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"4a09890e7dcbed35954ac1b7061451e4f1f39735","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            shell.main(argstr.split())"},{"line_number":350,"context_line":"            self.fail(\u0027No import error returned\u0027)"},{"line_number":351,"context_line":"        except ImportError as e:"},{"line_number":352,"context_line":"            self.assertEquals(msg, str(e))"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @mock.patch.object(openstack_shell.OpenStackImagesShell,"},{"line_number":355,"context_line":"                       \u0027get_subcommand_parser\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dac4157f_dbc4a741","line":352,"updated":"2015-04-20 15:04:00.000000000","message":"s/assertEquals/assertEqual","commit_id":"98b94ba8bf875d15541c592439f1b1535d381e8e"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"4a09890e7dcbed35954ac1b7061451e4f1f39735","unresolved":false,"context_lines":[{"line_number":362,"context_line":"            self.fail(\u0027No import error returned\u0027)"},{"line_number":363,"context_line":"        except ImportError as e:"},{"line_number":364,"context_line":"            msg \u003d \u0027Unable to import module. Re-run with --debug for more info.\u0027"},{"line_number":365,"context_line":"            self.assertEquals(msg, str(e))"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    @mock.patch(\u0027glanceclient.v1.client.Client\u0027)"},{"line_number":368,"context_line":"    def test_auth_plugin_invocation_without_username_with_v1(self, v1_client):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dac4157f_bbc1f330","line":365,"updated":"2015-04-20 15:04:00.000000000","message":"s/assertEquals/assertEqual","commit_id":"98b94ba8bf875d15541c592439f1b1535d381e8e"}]}
