)]}'
{"openstack/tests/functional/base.py":[{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"3d1cbd78516df6683520cc3086270975ffd4a53d","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def service_exists(**kwargs):"},{"line_number":25,"context_line":"    \"\"\"Decorator function to check whether a service exists"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Usage:"},{"line_number":28,"context_line":"    @unittest.skipUnless(base.service_exists(service_type\u003d\"metering\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_bc9a0613","line":25,"range":{"start_line":25,"start_character":7,"end_line":25,"end_character":16},"updated":"2016-01-12 18:45:37.000000000","message":"This ends up not being a decorator anymore, since it\u0027s a function call that the skipUnless decorator receives the value of. However, it seems like this would still be more useful as a decorator itself, similarly to how it was done before.\n\nDo you think we can restore the previous behavior and usability but implemented with the from_config enhancement and a message generated from the arguments? This seems like a decorator we should really have on every service just to be safe, so covering up the call to unittest.skipUnless as well as having each usage create it\u0027s own message would be nice to have.","commit_id":"ec13f35638585528b992c1b9f813e0be6e8e7ce4"},{"author":{"_account_id":1112,"name":"Everett Toews","email":"everett.toews@rackspace.com","username":"everett-toews"},"change_message_id":"6320b81bc97eebd7135f7f180c593daed9eef8c2","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def service_exists(**kwargs):"},{"line_number":25,"context_line":"    \"\"\"Decorator function to check whether a service exists"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Usage:"},{"line_number":28,"context_line":"    @unittest.skipUnless(base.service_exists(service_type\u003d\"metering\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_66f875e6","line":25,"range":{"start_line":25,"start_character":7,"end_line":25,"end_character":16},"in_reply_to":"da6ed579_bc9a0613","updated":"2016-01-12 20:59:53.000000000","message":"One problem with that approach is that that decorator has to be placed on each and every method of the test class. That\u0027s cumbersome from a code maintenance perspective and inefficient from a runtime perspective as it has to call out to the cloud for each test method.\n\nskipUnless (and skipIf) are kind of ideal as they are evaluated at class declaration time. We only need the decorate a class once and all test are skipped. The test totals report at the end are correct too.\n\nI\u0027d be willing to update the docstring if you think \"Decorator function\" is misleading. Maybe more like \"A function intended to be used in a decorator function like skipIf or skipUnless.\"","commit_id":"ec13f35638585528b992c1b9f813e0be6e8e7ce4"}],"openstack/tests/unit/test_functional_base.py":[{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"b0970527c958c91873ab72a8ebe887063c13b6e2","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        self.sess.get_endpoint \u003d mock.Mock()"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        self.assertEqual(True, base.service_exists(**self.kwargs))"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @mock.patch(\u0027openstack.connection.from_config\u0027)"},{"line_number":40,"context_line":"    def test_service_doesnt_exist(self, mock_from_config):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_9340df60","line":37,"updated":"2016-01-11 13:46:59.000000000","message":"I think that assertTrue() is preferred over assertEqual(True,...).","commit_id":"ec13f35638585528b992c1b9f813e0be6e8e7ce4"},{"author":{"_account_id":1112,"name":"Everett Toews","email":"everett.toews@rackspace.com","username":"everett-toews"},"change_message_id":"a1199d5477445bf984994e902d0097e29ae66467","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"        self.sess.get_endpoint \u003d mock.Mock()"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"        self.assertEqual(True, base.service_exists(**self.kwargs))"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    @mock.patch(\u0027openstack.connection.from_config\u0027)"},{"line_number":40,"context_line":"    def test_service_doesnt_exist(self, mock_from_config):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_40b34b50","line":37,"in_reply_to":"fa69d971_9340df60","updated":"2016-01-14 23:16:51.000000000","message":"Done","commit_id":"ec13f35638585528b992c1b9f813e0be6e8e7ce4"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"b0970527c958c91873ab72a8ebe887063c13b6e2","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.sess.get_endpoint \u003d mock.Mock("},{"line_number":44,"context_line":"            side_effect\u003d_exceptions.EndpointNotFound(\u0027\u0027))"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self.assertEqual(False, base.service_exists(**self.kwargs))"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_735c4b4b","line":46,"updated":"2016-01-11 13:46:59.000000000","message":"I think that assertFalse() is preferred over assertEqual(False,...).","commit_id":"ec13f35638585528b992c1b9f813e0be6e8e7ce4"},{"author":{"_account_id":1112,"name":"Everett Toews","email":"everett.toews@rackspace.com","username":"everett-toews"},"change_message_id":"a1199d5477445bf984994e902d0097e29ae66467","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.sess.get_endpoint \u003d mock.Mock("},{"line_number":44,"context_line":"            side_effect\u003d_exceptions.EndpointNotFound(\u0027\u0027))"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self.assertEqual(False, base.service_exists(**self.kwargs))"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_60ae8fe7","line":46,"in_reply_to":"fa69d971_735c4b4b","updated":"2016-01-14 23:16:51.000000000","message":"Done","commit_id":"ec13f35638585528b992c1b9f813e0be6e8e7ce4"}]}
