|
@@ -1,5 +1,6 @@
|
|
|
from __future__ import annotations
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
+from contextlib import contextmanager
|
|
|
import tempfile
|
|
import tempfile
|
|
|
from pathlib import Path
|
|
from pathlib import Path
|
|
|
|
|
|
|
@@ -354,12 +355,23 @@ def test_refresh_skips_reprocessing_when_feed_hash_is_unchanged(monkeypatch):
|
|
|
self.meta = {}
|
|
self.meta = {}
|
|
|
self.feed_hash = expected_hash
|
|
self.feed_hash = expected_hash
|
|
|
|
|
|
|
|
|
|
+ @contextmanager
|
|
|
|
|
+ def _conn(self):
|
|
|
|
|
+ class _Conn:
|
|
|
|
|
+ def execute(self, *args, **kwargs):
|
|
|
|
|
+ return None
|
|
|
|
|
+
|
|
|
|
|
+ yield _Conn()
|
|
|
|
|
+
|
|
|
def get_feed_hash(self, feed_key):
|
|
def get_feed_hash(self, feed_key):
|
|
|
return self.feed_hash
|
|
return self.feed_hash
|
|
|
|
|
|
|
|
def set_feed_hash(self, feed_key, last_hash):
|
|
def set_feed_hash(self, feed_key, last_hash):
|
|
|
self.feed_hash = last_hash
|
|
self.feed_hash = last_hash
|
|
|
|
|
|
|
|
|
|
+ def set_feed_state(self, feed_key, last_hash, item_count):
|
|
|
|
|
+ self.feed_hash = last_hash
|
|
|
|
|
+
|
|
|
def get_cluster_by_id(self, cluster_id):
|
|
def get_cluster_by_id(self, cluster_id):
|
|
|
return None
|
|
return None
|
|
|
|
|
|
|
@@ -584,12 +596,23 @@ def test_poller_persists_clusters_under_post_enrichment_topic(monkeypatch):
|
|
|
def __init__(self, *args, **kwargs):
|
|
def __init__(self, *args, **kwargs):
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
|
|
+ @contextmanager
|
|
|
|
|
+ def _conn(self):
|
|
|
|
|
+ class _Conn:
|
|
|
|
|
+ def execute(self, *args, **kwargs):
|
|
|
|
|
+ return None
|
|
|
|
|
+
|
|
|
|
|
+ yield _Conn()
|
|
|
|
|
+
|
|
|
def get_feed_hash(self, feed_key):
|
|
def get_feed_hash(self, feed_key):
|
|
|
return None
|
|
return None
|
|
|
|
|
|
|
|
def set_feed_hash(self, feed_key, last_hash):
|
|
def set_feed_hash(self, feed_key, last_hash):
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
|
|
+ def set_feed_state(self, feed_key, last_hash, item_count):
|
|
|
|
|
+ pass
|
|
|
|
|
+
|
|
|
def get_cluster_by_id(self, cluster_id):
|
|
def get_cluster_by_id(self, cluster_id):
|
|
|
return None
|
|
return None
|
|
|
|
|
|