def _test_dump(self, *args):
CONST.__setattr__('results_test_db_url', URL)
with mock.patch.object(decorators, 'open', mock.mock_open(),
create=True) as mock_open:
self.assertTrue(functest_utils.push_results_to_db(
self._project_name, self._case_name, self._start_time,
self._stop_time, self._result, {}))
mock_open.assert_called_once_with(FILE, 'a')
handle = mock_open()
call_args, _ = handle.write.call_args
self.assertIn('POST', call_args[0])
self.assertIn(self._get_json(), call_args[0])
args[0].assert_called_once_with()
评论列表
文章目录