def _test_common_body(self, source_list, expected): self._mox.ReplayAll() storage = PgStorageImpl(self._db_manager.connection_string, self._logger) for source in source_list: storage.save_data(source) actual = self._db_manager.execute_query(self._query) self._check_data(expected, actual) self._mox.VerifyAll()
def _test_common_body_with_exception(self, source, expected_exception): self._mox.ReplayAll() storage = PgStorageImpl(self._db_manager.connection_string, self._logger) self.assertRaises(expected_exception, lambda: storage.save_data(source)) self._mox.VerifyAll()