)]}'
{"bin/swift-get-nodes":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9304b5aa1908084cddabc739d7dce5f75a9ca586","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        args \u003d [p for p in path.split(\u0027/\u0027, 2) if p]"},{"line_number":65,"context_line":"    if len(args) \u003d\u003d 2 and \u0027/\u0027 in args[1]:"},{"line_number":66,"context_line":"        path \u003d args[1].lstrip(\u0027/\u0027)"},{"line_number":67,"context_line":"        args \u003d [args[0]] + [p for p in path.split(\u0027/\u0027, 2) if p]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    ring \u003d None"},{"line_number":70,"context_line":"    ring_name \u003d None"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"3aaa91ec_7613440e","side":"PARENT","line":67,"updated":"2016-06-27 22:25:34.000000000","message":"This logic would probably be cleaner *after* handling the ring argument - after determining if the first arg must be a ring, we can pop it off and convert any remaining rings to the split_path form?","commit_id":"c953e84e28b9b17e16bde7dfbbbdabca7acded13"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9304b5aa1908084cddabc739d7dce5f75a9ca586","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    if len(args) \u003d\u003d 0:"},{"line_number":55,"context_line":"        if not options.policy_name or not options.partition:"},{"line_number":56,"context_line":"            sys.exit(parser.print_help())"},{"line_number":57,"context_line":"    elif len(args) \u003e 4 or len(args) \u003d\u003d 0:"},{"line_number":58,"context_line":"        sys.exit(parser.print_help())"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    # Parse single path arg, as noted in above help text."}],"source_content_type":"application/octet-stream","patch_set":2,"id":"3aaa91ec_16be40ff","line":57,"updated":"2016-06-27 22:25:34.000000000","message":"probably just `or not args`","commit_id":"92554f899db7e743e01ae63948a38fcb6b5e58f4"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9304b5aa1908084cddabc739d7dce5f75a9ca586","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    ring_name \u003d None"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    if options.policy_name is None and len(args) \u003e\u003d 1:"},{"line_number":73,"context_line":"        if os.path.exists(args[0]) and args[0].endswith(\u0027ring.gz\u0027):"},{"line_number":74,"context_line":"            ring_name \u003d args[0].rsplit(\u0027/\u0027, 1)[-1].split(\u0027.\u0027, 1)[0]"},{"line_number":75,"context_line":"            ring \u003d Ring(args[0])"},{"line_number":76,"context_line":"            args.pop(0)"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"3aaa91ec_96c990af","line":73,"updated":"2016-06-27 22:25:34.000000000","message":"Checking `and len(args) \u003e\u003d 1` and `endswith(\u0027ring.gz\u0027)` here should be redundant, if `not options.policy_name` the first arg must be a path to a ring?","commit_id":"92554f899db7e743e01ae63948a38fcb6b5e58f4"}],"test/unit/cli/test_info.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a5bdb77931f713ccf1210720ce43e583eae467e9","unresolved":false,"context_lines":[{"line_number":483,"context_line":"        options \u003d Namespace(policy_name\u003d\u0027test\u0027)"},{"line_number":484,"context_line":"        args \u003d \u0027a c o\u0027"},{"line_number":485,"context_line":"        self.assertRaises(InfoSystemExit,"},{"line_number":486,"context_line":"                          parse_get_node_args, options, args.split())"},{"line_number":487,"context_line":"        # objects.ring.gz a/c/o"},{"line_number":488,"context_line":"        options \u003d Namespace(policy_name\u003dNone)"},{"line_number":489,"context_line":"        args \u003d \u0027object.ring.gz a/c/o\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_c4f2706e","line":486,"updated":"2016-07-01 10:22:42.000000000","message":"Something about this case seems off... did it fail because the test policy wasn\u0027t defined?\n\nself.assertRaises has this context manager syntax you can use to capture the error and assert the message [1].  Maybe try that and make sure you have tests for all the various InfoSystemExit raises that the method might hit.\n\nThere\u0027s also a context manager helper you can use to mock out storage policy loading in tests [2].  Maybe try to make sure that you have a test for an invalid policy name, and *also* one for a policy name that is \"defined\".\n\n1. https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.assertRaises\n2. https://github.com/openstack/swift/blob/029c2782ddfd933af20b697c00a46b1375e0f23e/test/unit/cli/test_recon.py#L392","commit_id":"8b73c50cec6165b98e0a1cf787664e9f3ec19666"}]}
