)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7488,"name":"Jeffrey Zhang","email":"zhang.lei.fly@gmail.com","username":"Jeffrey4l"},"change_message_id":"c80bb05c7ff12c88e47248ace0739a23a03f1f67","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add unit test for stop and restart container"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Icd73eb6e2d5b4207142ef249c8995c98056ae1c4"},{"line_number":10,"context_line":"Partially-Implements: blueprint enable-congress-container"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a9d85d2_ddbf8ef9","line":10,"updated":"2016-06-21 08:31:41.000000000","message":"you are not implements this bp now.","commit_id":"a2b45ce474b62d50f5f717e6780bef17290a9b03"},{"author":{"_account_id":11105,"name":"Swapnil Kulkarni","email":"coolsvap@gmail.com","username":"coolsvap"},"change_message_id":"2d01e33196f67a10b1f06736a500b3dbda349149","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add unit test for stop and restart container"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Icd73eb6e2d5b4207142ef249c8995c98056ae1c4"},{"line_number":10,"context_line":"Partially-Implements: blueprint enable-congress-container"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5a9d85d2_bf638c40","line":10,"in_reply_to":"5a9d85d2_ddbf8ef9","updated":"2016-06-21 12:19:13.000000000","message":"Please change the blueprint :)","commit_id":"a2b45ce474b62d50f5f717e6780bef17290a9b03"}],"tests/test_kolla_docker.py":[{"author":{"_account_id":7488,"name":"Jeffrey Zhang","email":"zhang.lei.fly@gmail.com","username":"Jeffrey4l"},"change_message_id":"c80bb05c7ff12c88e47248ace0739a23a03f1f67","unresolved":false,"context_lines":[{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def test_stop_container(self):"},{"line_number":256,"context_line":"        self.fake_data[\u0027params\u0027].update({\u0027name\u0027: \u0027my_container\u0027})"},{"line_number":257,"context_line":"        self.dw \u003d get_DockerWorker(self.fake_data[\u0027params\u0027])"},{"line_number":258,"context_line":"        self.dw.dc.containers \u003d mock.MagicMock("},{"line_number":259,"context_line":"            return_value\u003dself.fake_data[\u0027containers\u0027])"},{"line_number":260,"context_line":"        self.dw.dc.stop \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a9d85d2_bdba8208","line":257,"updated":"2016-06-21 08:31:41.000000000","message":"the DockerWorker need a ansible module param. But you fake_data is a dict that used\nby Docker-py.\n\nand here just need to run `stop_container` action. no need pass so many parameters.\n\n{ action: stop_container, name: my_container } is enough.","commit_id":"a2b45ce474b62d50f5f717e6780bef17290a9b03"},{"author":{"_account_id":7488,"name":"Jeffrey Zhang","email":"zhang.lei.fly@gmail.com","username":"Jeffrey4l"},"change_message_id":"c80bb05c7ff12c88e47248ace0739a23a03f1f67","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        self.assertTrue(self.dw.changed)"},{"line_number":263,"context_line":"        self.dw.dc.containers.assert_called_once_with(all\u003dTrue)"},{"line_number":264,"context_line":"        self.dw.dc.stop.assert_called_once_with("},{"line_number":265,"context_line":"            self.fake_data[\u0027params\u0027].get(\u0027name\u0027))"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    def test_restart_container(self):"},{"line_number":268,"context_line":"        self.fake_data[\u0027params\u0027].update({\u0027name\u0027: \u0027my_container\u0027})"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a9d85d2_1d38f69f","line":265,"updated":"2016-06-21 08:31:41.000000000","message":"and you are using mock in a wrong way. no need to create so many MagicMock object.\nfollowing code works well.\n\n    def test_stop_container(self):\n        self.dw \u003d get_DockerWorker({\"name\": \"my_container\", \"action\": \"stop_container\"})\n        self.dw.dc.containers.return_value\u003dself.fake_data[\u0027containers\u0027]\n        self.dw.stop_container()\n\n        self.assertTrue(self.dw.changed)\n        self.dw.dc.containers.assert_called_once_with(all\u003dTrue)\n        self.dw.dc.stop.assert_called_once_with(\"my_container\")","commit_id":"a2b45ce474b62d50f5f717e6780bef17290a9b03"}]}
