)]}'
{"nova/objects/cell_mapping.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f130964bc9fb5aefaa246ad8bc63c3397e8f0145","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @staticmethod"},{"line_number":42,"context_line":"    def _get_by_uuid_from_db(context, uuid):"},{"line_number":43,"context_line":"        session \u003d db_api.get_api_session()"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        with session.begin():"},{"line_number":46,"context_line":"            db_mapping \u003d session.query(api_models.CellMapping).filter_by("}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_3c96e9f0","line":43,"updated":"2015-03-13 11:29:12.000000000","message":"What about pulling out all these into a CellMappingImpl object, so it would just be a case of passing in a new impl object?\n\nYou can actually pass in a mock to the constructor to mock out the whole impl that way.\n\nIts basically dependency injection. I don\u0027t think it will cost that much, just something like: self.db_impl.get_uuid(context, uuid)","commit_id":"5e2cd3119c183004dfcd5324fc39e40f6a1236dc"},{"author":{"_account_id":12548,"name":"Dheeraj Gupta","email":"dheeraj.gupta4@gmail.com","username":"dgupta"},"change_message_id":"d7322e524d5116965274f34db6f82490e4f3668a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from nova.objects import fields"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class CellMapping(base.NovaTimestampObject, base.NovaObject):"},{"line_number":21,"context_line":"    # Version 1.0: Initial version"},{"line_number":22,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_defb4a46","line":20,"updated":"2015-03-18 09:23:06.000000000","message":"Since CellMapping models does not have created_at and updated_at fields, why does this need to inherit from NovaTimestampObject?","commit_id":"bf6b6136f1be56c30584a901f429186dc629ae61"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1f48fcc82fd483e3c77f0dc747dc61fb7a3a69d6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from nova.objects import fields"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class CellMapping(base.NovaTimestampObject, base.NovaObject):"},{"line_number":21,"context_line":"    # Version 1.0: Initial version"},{"line_number":22,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_37d47fbc","line":20,"in_reply_to":"9a80dd14_defb4a46","updated":"2015-03-18 14:04:16.000000000","message":"It does have these fields.  You will see them in the actual db migration.  And they are added to the sqlalchemy model by inheriting from models.TimestampMixin.","commit_id":"bf6b6136f1be56c30584a901f429186dc629ae61"}],"nova/tests/functional/db/test_cell_mapping.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6d693382f6d952159db637dd83bbd4fa6c7bb6b0","unresolved":false,"context_lines":[{"line_number":23,"context_line":"DB_SCHEMA \u003d \u0027\u0027"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ApiDatabase(fixtures.Fixture):"},{"line_number":27,"context_line":"    def _cache_schema(self):"},{"line_number":28,"context_line":"        global DB_SCHEMA"},{"line_number":29,"context_line":"        if not DB_SCHEMA:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_45eac674","line":26,"updated":"2015-03-13 21:31:09.000000000","message":"This should be split out, just getting things working.","commit_id":"1c1d37227544f46033bd644326a0328b8ed2679b"},{"author":{"_account_id":12548,"name":"Dheeraj Gupta","email":"dheeraj.gupta4@gmail.com","username":"dgupta"},"change_message_id":"d7322e524d5116965274f34db6f82490e4f3668a","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                self.mapping_obj._get_by_uuid_from_db, self.context,"},{"line_number":70,"context_line":"                mapping[\u0027uuid\u0027])"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def test_destroy_in_db_not_found(self):"},{"line_number":73,"context_line":"        mapping \u003d self.create_mapping()"},{"line_number":74,"context_line":"        self.mapping_obj._get_by_uuid_from_db(self.context, mapping[\u0027uuid\u0027])"},{"line_number":75,"context_line":"        self.mapping_obj._destroy_in_db(self.context, mapping[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_796d18cc","line":72,"updated":"2015-03-18 09:23:06.000000000","message":"For the not found test, it may be better to skip creation altogether and just do an assertRaises on _destroy_in_db","commit_id":"bf6b6136f1be56c30584a901f429186dc629ae61"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1f48fcc82fd483e3c77f0dc747dc61fb7a3a69d6","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                self.mapping_obj._get_by_uuid_from_db, self.context,"},{"line_number":70,"context_line":"                mapping[\u0027uuid\u0027])"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def test_destroy_in_db_not_found(self):"},{"line_number":73,"context_line":"        mapping \u003d self.create_mapping()"},{"line_number":74,"context_line":"        self.mapping_obj._get_by_uuid_from_db(self.context, mapping[\u0027uuid\u0027])"},{"line_number":75,"context_line":"        self.mapping_obj._destroy_in_db(self.context, mapping[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a80dd14_17e85b7b","line":72,"in_reply_to":"9a80dd14_796d18cc","updated":"2015-03-18 14:04:16.000000000","message":"Yes.  I think I meant to do that and then just copied the test above for some reason.","commit_id":"bf6b6136f1be56c30584a901f429186dc629ae61"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"03f8fab0fdf50fb0e14b2aeaffab8175a2c3caf8","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova.tests import fixtures"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class CellMappingTestCase(test.TestCase):"},{"line_number":23,"context_line":"    def setUp(self):"},{"line_number":24,"context_line":"        super(CellMappingTestCase, self).setUp()"},{"line_number":25,"context_line":"        self.useFixture(fixtures.Database(database\u003d\u0027api\u0027))"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_03b9fdca","line":22,"updated":"2015-03-18 15:27:03.000000000","message":"The base class seems inconsistent with the one here: https://review.openstack.org/#/c/161904/7/nova/tests/functional/db/test_instance_mapping.py,cm\n\nI am curious if thats a problem.","commit_id":"f45b982a765af794427404c6b403603c9cdaf2e5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"03f8fab0fdf50fb0e14b2aeaffab8175a2c3caf8","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                \u0027transport_url\u0027: \u0027rabbit:///\u0027,"},{"line_number":33,"context_line":"                \u0027database_connection\u0027: \u0027mysql:///\u0027}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def create_mapping(self, **kwargs):"},{"line_number":36,"context_line":"        args \u003d self.sample_mapping.copy()"},{"line_number":37,"context_line":"        if \u0027uuid\u0027 not in kwargs:"},{"line_number":38,"context_line":"            args[\u0027uuid\u0027] \u003d self.uuid"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a80dd14_e3c6a915","line":35,"updated":"2015-03-18 15:27:03.000000000","message":"tempted by an underscore here, just so its clear its not a test, but its a micro nit.","commit_id":"f45b982a765af794427404c6b403603c9cdaf2e5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"29fda2e17c204fa1807e16737ca52aa9f2742b22","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                \u0027database_connection\u0027: \u0027mysql:///\u0027}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def _create_mapping(self, **kwargs):"},{"line_number":36,"context_line":"        args \u003d self.sample_mapping.copy()"},{"line_number":37,"context_line":"        if \u0027uuid\u0027 not in kwargs:"},{"line_number":38,"context_line":"            args[\u0027uuid\u0027] \u003d self.uuid"},{"line_number":39,"context_line":"        args.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a80dd14_5f80188b","line":36,"updated":"2015-03-18 19:36:44.000000000","message":"This is the only use, so not sure it needs to be a class-level thing, but okay :D","commit_id":"8a6b1d144849d04285e298209b7f03b6fd49bea4"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"56295865abe9fcfdd347109fac4844ed3fbd6c0f","unresolved":false,"context_lines":[{"line_number":33,"context_line":"                \u0027database_connection\u0027: \u0027mysql:///\u0027}"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def _create_mapping(self, **kwargs):"},{"line_number":36,"context_line":"        args \u003d self.sample_mapping.copy()"},{"line_number":37,"context_line":"        if \u0027uuid\u0027 not in kwargs:"},{"line_number":38,"context_line":"            args[\u0027uuid\u0027] \u003d self.uuid"},{"line_number":39,"context_line":"        args.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a80dd14_775b4022","line":36,"in_reply_to":"9a80dd14_5f80188b","updated":"2015-03-18 21:07:50.000000000","message":"Heh, true.  It\u0027s a holdover from before I factored out a _create_mapping method.  I may clean it up later.","commit_id":"8a6b1d144849d04285e298209b7f03b6fd49bea4"}],"nova/tests/unit/objects/test_cell_mapping.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f130964bc9fb5aefaa246ad8bc63c3397e8f0145","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class _TestCellMappingObject(object):"},{"line_number":37,"context_line":"    @mock.patch.object(cell_mapping.CellMapping, \u0027_get_by_uuid_from_db\u0027)"},{"line_number":38,"context_line":"    def test_get_by_uuid(self, uuid_from_db):"},{"line_number":39,"context_line":"        db_mapping \u003d get_db_mapping()"},{"line_number":40,"context_line":"        uuid_from_db.return_value \u003d db_mapping"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_5c69ddf7","line":37,"updated":"2015-03-13 11:29:12.000000000","message":"Don\u0027t we need some tests for the _get_by_uuid_from_db method itself? Something like this stuff:\nhttps://github.com/openstack/nova/blob/master/nova/tests/unit/db/test_db_api.py#L1182","commit_id":"5e2cd3119c183004dfcd5324fc39e40f6a1236dc"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1721b15c48275f5f0e1307a725df6eb02101a11b","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class _TestCellMappingObject(object):"},{"line_number":37,"context_line":"    @mock.patch.object(cell_mapping.CellMapping, \u0027_get_by_uuid_from_db\u0027)"},{"line_number":38,"context_line":"    def test_get_by_uuid(self, uuid_from_db):"},{"line_number":39,"context_line":"        db_mapping \u003d get_db_mapping()"},{"line_number":40,"context_line":"        uuid_from_db.return_value \u003d db_mapping"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_517b71bd","line":37,"in_reply_to":"9a80dd14_5c69ddf7","updated":"2015-03-13 18:23:02.000000000","message":"Yes.  Working on those now.","commit_id":"5e2cd3119c183004dfcd5324fc39e40f6a1236dc"}]}
