)]}'
{"keystone/tests/test_backend_ldap.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d95bae489cce9916045d6051b8ab5b361466cff1","unresolved":false,"context_lines":[{"line_number":889,"context_line":"        # Ensure the username/password are in-fact blank"},{"line_number":890,"context_line":"        self.config_fixture.config(group\u003d\u0027ldap\u0027, user\u003dNone, password\u003dNone)"},{"line_number":891,"context_line":"        user_api \u003d identity.backends.ldap.UserApi(CONF)"},{"line_number":892,"context_line":"        with mock.patch.object(fakeldap.FakeLdap, \u0027simple_bind_s\u0027) as mocked:"},{"line_number":893,"context_line":"            user_api.get_connection(user\u003dNone, password\u003dNone)"},{"line_number":894,"context_line":"        self.assertEqual(mocked.call_count, 0,"},{"line_number":895,"context_line":"                         \u0027`simple_bind_s` method was unexpectedly called\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BTXk%3D","line":892,"updated":"2014-03-27 18:40:32.000000000","message":"I\u0027d expect this to be done with a @mock.patch.object decorator on the method.","commit_id":"04c96191352773147d7f7ba7b7dccc45ebf14802"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d95bae489cce9916045d6051b8ab5b361466cff1","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        user_api \u003d identity.backends.ldap.UserApi(CONF)"},{"line_number":892,"context_line":"        with mock.patch.object(fakeldap.FakeLdap, \u0027simple_bind_s\u0027) as mocked:"},{"line_number":893,"context_line":"            user_api.get_connection(user\u003dNone, password\u003dNone)"},{"line_number":894,"context_line":"        self.assertEqual(mocked.call_count, 0,"},{"line_number":895,"context_line":"                         \u0027`simple_bind_s` method was unexpectedly called\u0027)"},{"line_number":896,"context_line":""},{"line_number":897,"context_line":"    def _mock_fakeldap_init_and_get_connection(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BTYA%3D","line":894,"updated":"2014-03-27 18:40:32.000000000","message":"use mock.called rather than call_count","commit_id":"04c96191352773147d7f7ba7b7dccc45ebf14802"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d95bae489cce9916045d6051b8ab5b361466cff1","unresolved":false,"context_lines":[{"line_number":899,"context_line":"        # Track the instantiation of the FakeLdap object with Mock so we can"},{"line_number":900,"context_line":"        # ensure \"chase_refferals\" is the correct value"},{"line_number":901,"context_line":"        with mock.patch.object(fakeldap.FakeLdap, \u0027__init__\u0027,"},{"line_number":902,"context_line":"                               return_value\u003dNone) as mocked_fakeldap:"},{"line_number":903,"context_line":"            user_api.get_connection(user\u003dNone, password\u003dNone)"},{"line_number":904,"context_line":""},{"line_number":905,"context_line":"        return mocked_fakeldap"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BTWM%3D","line":902,"updated":"2014-03-27 18:40:32.000000000","message":"My opinion here is that the mock.patch.object should be done on the test methods so that it\u0027s done up front and lasts for the entire test. I think this would be safer in terms of changes to the code.\n\nThen there\u0027s probably not a need for this method since there\u0027d only be the 2 functions called in here.","commit_id":"04c96191352773147d7f7ba7b7dccc45ebf14802"}]}
