)]}'
{"nova/tests/unit/api/openstack/compute/test_keypairs.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"7b4df1dede8cf154758b5c5dc28e62e3f5ead8f7","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                       _db_key_pair_get)"},{"line_number":362,"context_line":"        self.stubs.Set(db, \"key_pair_get_all_by_user\","},{"line_number":363,"context_line":"                       db_key_pair_get_all_by_user)"},{"line_number":364,"context_line":"        self.stubs.Set(db, \"key_pair_create\","},{"line_number":365,"context_line":"                       db_key_pair_create)"},{"line_number":366,"context_line":"        self.stubs.Set(db, \"key_pair_destroy\","},{"line_number":367,"context_line":"                       db_key_pair_destroy)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_6d6df231","line":364,"updated":"2015-11-16 12:37:22.000000000","message":"We already fake the db call, I guess the reason of \u0027test_keypair_create_pass_policy\u0027 won\u0027t pass is we should stubs \u0027key_pair_count_by_user\u0027.\n\nBecause I get error as below:\nFile \"/opt/stack/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_versionedobjects/base.py\", line 171, in wrapper\n        result \u003d fn(cls, context, *args, **kwargs)\n      File \"nova/objects/keypair.py\", line 102, in get_count_by_user\n        return db.key_pair_count_by_user(context, user_id)\n      File \"nova/db/api.py\", line 922, in key_pair_count_by_user\n        return IMPL.key_pair_count_by_user(context, user_id)\n      File \"nova/db/sqlalchemy/api.py\", line 204, in wrapper\n        return f(*args, **kwargs)\n      File \"nova/db/sqlalchemy/api.py\", line 2790, in key_pair_count_by_user\n        filter_by(user_id\u003duser_id).\\","commit_id":"a22d0ce343c2c6f66cf35f13ebb73448533ba9b8"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"644ac27d8f314164594b9c241697351df1cd1afb","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                       _db_key_pair_get)"},{"line_number":362,"context_line":"        self.stubs.Set(db, \"key_pair_get_all_by_user\","},{"line_number":363,"context_line":"                       db_key_pair_get_all_by_user)"},{"line_number":364,"context_line":"        self.stubs.Set(db, \"key_pair_create\","},{"line_number":365,"context_line":"                       db_key_pair_create)"},{"line_number":366,"context_line":"        self.stubs.Set(db, \"key_pair_destroy\","},{"line_number":367,"context_line":"                       db_key_pair_destroy)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_dca92ae1","line":364,"in_reply_to":"ba8a016a_6d6df231","updated":"2015-11-16 14:04:39.000000000","message":"this is only a mock of db,\nI mocked whole compute_api call because we don\u0027t call this in the policy test\n\nthe function you saw is coming from KeypairAPI._validate_new_key_pair\nwhich is used to check quota, seems we don\u0027t need to consider this if it\u0027s a policy test","commit_id":"a22d0ce343c2c6f66cf35f13ebb73448533ba9b8"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"75f1b2af454a8eb854a1e9d935fad5fffdf8cbfb","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                       _db_key_pair_get)"},{"line_number":362,"context_line":"        self.stubs.Set(db, \"key_pair_get_all_by_user\","},{"line_number":363,"context_line":"                       db_key_pair_get_all_by_user)"},{"line_number":364,"context_line":"        self.stubs.Set(db, \"key_pair_create\","},{"line_number":365,"context_line":"                       db_key_pair_create)"},{"line_number":366,"context_line":"        self.stubs.Set(db, \"key_pair_destroy\","},{"line_number":367,"context_line":"                       db_key_pair_destroy)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_e511f25e","line":364,"in_reply_to":"ba8a016a_dca92ae1","updated":"2015-11-16 14:48:28.000000000","message":"Actually I mean we should only use one way to fake the db api. If the mock works, the line 360-367 should be removed.","commit_id":"a22d0ce343c2c6f66cf35f13ebb73448533ba9b8"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"c1ca3aa8158dfcb91324ca0a2a4ebb2535dd6d5d","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                       _db_key_pair_get)"},{"line_number":362,"context_line":"        self.stubs.Set(db, \"key_pair_get_all_by_user\","},{"line_number":363,"context_line":"                       db_key_pair_get_all_by_user)"},{"line_number":364,"context_line":"        self.stubs.Set(db, \"key_pair_create\","},{"line_number":365,"context_line":"                       db_key_pair_create)"},{"line_number":366,"context_line":"        self.stubs.Set(db, \"key_pair_destroy\","},{"line_number":367,"context_line":"                       db_key_pair_destroy)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_35cab6a2","line":364,"in_reply_to":"ba8a016a_e511f25e","updated":"2015-11-16 20:04:14.000000000","message":"the other cases need this ,in order to change as less as we can \nthe only mock below seems better and we need to keep 360-367 lines , otherwise you will get 103 test failures ...","commit_id":"a22d0ce343c2c6f66cf35f13ebb73448533ba9b8"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"0a20ec47baab31833e5ce7cc7bbd195369bb6079","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        policy.set_rules(rules)"},{"line_number":418,"context_line":"        res \u003d self.KeyPairController.create(self.req, body\u003dbody)"},{"line_number":419,"context_line":"        self.assertIn(\u0027keypair\u0027, res)"},{"line_number":420,"context_line":"        self.assertTrue(mock_create.called)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    def test_keypair_delete_fail_policy(self):"},{"line_number":423,"context_line":"        rules \u003d {self.policy_path + \u0027:delete\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a8ffd7b_092f7df7","line":420,"updated":"2015-11-30 14:33:58.000000000","message":"we should really do an assert_called_with","commit_id":"1aca70238d239d30b344eefc78ab79808585f7d2"}]}
