)]}'
{"nova/tests/unit/virt/libvirt/test_imagebackend.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"471b939e767dc5f932d31e3df24801eaad709b9f","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        # Ensure can_fallocate is not initialised on the class"},{"line_number":102,"context_line":"        if hasattr(self.image_class, \u0027can_fallocate\u0027):"},{"line_number":103,"context_line":"            del self.image_class.can_fallocate"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        fake_processutils.fake_execute_clear_log()"},{"line_number":106,"context_line":"        fake_processutils.stub_out_processutils_execute(self.stubs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_eecf69b1","line":103,"updated":"2016-07-27 20:17:01.000000000","message":"I think this belongs in the base class setUp(). Doing it here is just asking for another test to hit it (if not already).","commit_id":"41783e70b3c6ad5fa10e5d27e4632f5af7eca6b2"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"6b8a63a53b72ce05c92d3c30580aa2bf400f0c40","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        # Ensure can_fallocate is not initialised on the class"},{"line_number":102,"context_line":"        if hasattr(self.image_class, \u0027can_fallocate\u0027):"},{"line_number":103,"context_line":"            del self.image_class.can_fallocate"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        fake_processutils.fake_execute_clear_log()"},{"line_number":106,"context_line":"        fake_processutils.stub_out_processutils_execute(self.stubs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_14148af3","line":103,"in_reply_to":"bacf61ea_eecf69b1","updated":"2016-07-27 21:05:20.000000000","message":"Done","commit_id":"41783e70b3c6ad5fa10e5d27e4632f5af7eca6b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b616938f001b00ce34ef67e7a4ef0f032ddc6117","unresolved":false,"context_lines":[{"line_number":1,"context_line":""},{"line_number":2,"context_line":"# Copyright 2012 Grid Dynamics"},{"line_number":3,"context_line":"# All Rights Reserved."},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_2c1ee96f","line":1,"updated":"2016-08-01 17:17:43.000000000","message":"Random whitespace add","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"c8e7da5af83e97a5c7fe027d5ce147189edca1a5","unresolved":false,"context_lines":[{"line_number":1,"context_line":""},{"line_number":2,"context_line":"# Copyright 2012 Grid Dynamics"},{"line_number":3,"context_line":"# All Rights Reserved."},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_7da2119c","line":1,"in_reply_to":"bacf61ea_2c1ee96f","updated":"2016-08-02 16:05:18.000000000","message":"Whoops. I\u0027ll fix this.","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"55264bed998564d172b2fa71e40bb1c030ead78c","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.TEMPLATE_PATH \u003d os.path.join(self.TEMPLATE_DIR, \u0027template\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Ensure can_fallocate is not initialised on the class"},{"line_number":92,"context_line":"        if hasattr(self.image_class, \u0027can_fallocate\u0027):"},{"line_number":93,"context_line":"            del self.image_class.can_fallocate"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_a76f4891","line":92,"updated":"2016-07-28 03:06:05.000000000","message":"self.image_class is not defined unless the caller has defined it (as you do in the subclass setup method below). That\u0027s why I prefer to do subclass specific initialisation in the subclass.\n\nI suppose you could say if this raises an exception the class is not being used properly - but in that case I would prefer the exception to describe why it is wrong instead of raising a generic NameError.","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"743148743a5a85368e5d1916409e6396f3c768ed","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.TEMPLATE_PATH \u003d os.path.join(self.TEMPLATE_DIR, \u0027template\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Ensure can_fallocate is not initialised on the class"},{"line_number":92,"context_line":"        if hasattr(self.image_class, \u0027can_fallocate\u0027):"},{"line_number":93,"context_line":"            del self.image_class.can_fallocate"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_1e78c48e","line":92,"in_reply_to":"bacf61ea_9b220600","updated":"2016-07-29 13:49:11.000000000","message":"This is a purpose-built mixin class for a test. I think it\u0027s fine to just do what is convenient, which is what she has here. If it wasn\u0027t a test, it might be worth being a little more explicit, but.. tests are here to serve the humans.. :)","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"491124918969761ba36e73979dfa6dcd3e68ff69","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.TEMPLATE_PATH \u003d os.path.join(self.TEMPLATE_DIR, \u0027template\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Ensure can_fallocate is not initialised on the class"},{"line_number":92,"context_line":"        if hasattr(self.image_class, \u0027can_fallocate\u0027):"},{"line_number":93,"context_line":"            del self.image_class.can_fallocate"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_dfd3ff5d","line":92,"in_reply_to":"bacf61ea_a76f4891","updated":"2016-07-28 15:42:15.000000000","message":"Yup, I hear you (for non-unit tests code), but pre/post super initializations in setUp is how I\u0027ve typically seen this handled in unit tests.\n\nWhat would you suggest instead? Some of the usual OO approaches won\u0027t work here (they interfere with unittest\u0027s test discovery/loading), and other approaches require repetition in each subclass (and introduce the possibility of forgetting \u003d\u003e buggy tests again). \n\nThe image_class attribute is fundamental to all the tests that inherit from _ImageTestCase. If you don\u0027t set it in the subclass, every test will fail (even before this change), so I don\u0027t think it warrants a special description/exception. It\u0027s pretty easy code to follow when/if it fails.","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"bbcb2fc3cec60052671490906d7d011531901d63","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        self.TEMPLATE_PATH \u003d os.path.join(self.TEMPLATE_DIR, \u0027template\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # Ensure can_fallocate is not initialised on the class"},{"line_number":92,"context_line":"        if hasattr(self.image_class, \u0027can_fallocate\u0027):"},{"line_number":93,"context_line":"            del self.image_class.can_fallocate"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_9b220600","line":92,"in_reply_to":"bacf61ea_dfd3ff5d","updated":"2016-07-29 13:43:06.000000000","message":"I don\u0027t know, maybe I\u0027m being too pedantic. \n\nYou could just a add comment to say the subclass should define self.image_class. If I used this for another test and got it wrong I would appreciate a helpful hint about what I did wrong.\n\nI\u0027ll remove the -1 and see if anyone else comments.","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"55264bed998564d172b2fa71e40bb1c030ead78c","unresolved":false,"context_lines":[{"line_number":787,"context_line":"    SIZE \u003d 1024"},{"line_number":788,"context_line":""},{"line_number":789,"context_line":"    def setUp(self):"},{"line_number":790,"context_line":"        self.image_class \u003d imagebackend.Lvm"},{"line_number":791,"context_line":"        super(EncryptedLvmTestCase, self).setUp()"},{"line_number":792,"context_line":"        self.flags(enabled\u003dTrue, group\u003d\u0027ephemeral_storage_encryption\u0027)"},{"line_number":793,"context_line":"        self.flags(cipher\u003d\u0027aes-xts-plain64\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_47264cbb","line":790,"updated":"2016-07-28 03:06:05.000000000","message":"I\u0027m not really a fan of initialisation in the base class depending on things in the subclass.","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"491124918969761ba36e73979dfa6dcd3e68ff69","unresolved":false,"context_lines":[{"line_number":787,"context_line":"    SIZE \u003d 1024"},{"line_number":788,"context_line":""},{"line_number":789,"context_line":"    def setUp(self):"},{"line_number":790,"context_line":"        self.image_class \u003d imagebackend.Lvm"},{"line_number":791,"context_line":"        super(EncryptedLvmTestCase, self).setUp()"},{"line_number":792,"context_line":"        self.flags(enabled\u003dTrue, group\u003d\u0027ephemeral_storage_encryption\u0027)"},{"line_number":793,"context_line":"        self.flags(cipher\u003d\u0027aes-xts-plain64\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"bacf61ea_5f78af2b","line":790,"in_reply_to":"bacf61ea_47264cbb","updated":"2016-07-28 15:42:15.000000000","message":"Of the 6 test classes that inherit from _ImageTestCase, this was the only class that failed to initialize image_class before calling super, so I don\u0027t think this patch changes the original intent, but rather fixes it to be consistent with the others.","commit_id":"cab4eb202ac14861bf7c0ffac5e52d366a3302a2"}]}
