)]}'
{"watcher/tests/cmd/test_db_manage.py":[{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"e720536160d2412c1ce6c0b62454c42af2d02c55","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                              enforce_type\u003dTrue)"},{"line_number":47,"context_line":"        # Only append if the command is not None"},{"line_number":48,"context_line":"        m_sys.argv \u003d list(filter(None, [\"watcher-db-manage\", self.command]))"},{"line_number":49,"context_line":"        m_func.side_effect \u003d dbmanage.DBCommand.upgrade"},{"line_number":50,"context_line":"        dbmanage.main()"},{"line_number":51,"context_line":"        self.assertEqual(m_func.call_count, 0)"},{"line_number":52,"context_line":"        m_prepare_service.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_2297843b","line":49,"updated":"2016-01-13 22:16:00.000000000","message":"We can\u0027t hard code this to be the actual upgrade method as this test gets ran for each of the scenarios above (downgrade, revision, stamp, etc.).  Running the function would probably fail as well since there\u0027s no DB set up here.","commit_id":"9135653091f4d923fa4c23b18b3c5b95359c194c"},{"author":{"_account_id":13289,"name":"Taylor Peoples","email":"tpeoples@us.ibm.com","username":"tpeoples"},"change_message_id":"e720536160d2412c1ce6c0b62454c42af2d02c55","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    @patch.object(dbmanage, \"register_sub_command_opts\", Mock())"},{"line_number":39,"context_line":"    @patch(\"watcher.cmd.dbmanage.service.prepare_service\")"},{"line_number":40,"context_line":"    @patch(\"watcher.cmd.dbmanage.sys\")"},{"line_number":41,"context_line":"    def test_run_db_manage_app(self, m_sys, m_prepare_service):"},{"line_number":42,"context_line":"        # Patch command arguments"},{"line_number":43,"context_line":"        m_func \u003d Mock()"},{"line_number":44,"context_line":"        cfg.CONF.register_opt(cfg.Opt(\"func\", type\u003dMock), group\u003d\"command\")"},{"line_number":45,"context_line":"        cfg.CONF.set_override(\"func\", m_func, group\u003d\"command\","},{"line_number":46,"context_line":"                              enforce_type\u003dTrue)"},{"line_number":47,"context_line":"        # Only append if the command is not None"},{"line_number":48,"context_line":"        m_sys.argv \u003d list(filter(None, [\"watcher-db-manage\", self.command]))"},{"line_number":49,"context_line":"        m_func.side_effect \u003d dbmanage.DBCommand.upgrade"},{"line_number":50,"context_line":"        dbmanage.main()"},{"line_number":51,"context_line":"        self.assertEqual(m_func.call_count, 0)"},{"line_number":52,"context_line":"        m_prepare_service.assert_called_once_with("},{"line_number":53,"context_line":"            [\"watcher-db-manage\", self.expected]"},{"line_number":54,"context_line":"        )"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"class TestDBManageRunCommand(TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_c250e8d6","line":54,"range":{"start_line":41,"start_character":0,"end_line":54,"end_character":9},"updated":"2016-01-13 22:16:00.000000000","message":"I think this needs to look like:\n\n  def test_run_db_manage_app(self, m_sys, m_prepare_service):\n    # Patch command function\n    m_func \u003d Mock()\n    cfg.CONF.register_opt(cfg.SubCommandOpt(\"command\"))\n    cfg.CONF.command.func \u003d m_func\n    \n    # Only append if the command is not None\n    m_sys.argv \u003d list(filter(None, [\"watcher-db-manage\", self.command]))\n\n    dbmanage.main()\n    self.assertEqual(m_func.call_count, 1)\n    m_prepare_service.assert_called_once_with(\n      [\"watcher-db-manage\", self.expected])\n\nI don\u0027t think what the test was doing previously was correct.  func isn\u0027t an option in the command group, it is actually a function \"attached\" to the command group via argparse.","commit_id":"9135653091f4d923fa4c23b18b3c5b95359c194c"}]}
