test: retarget v2 coverage monkeypatch targets to definition modules after handler split (assertions unchanged)
This commit is contained in:
1 parent
6e0660e97b
commit
741eb387ed
7 files changed
+45
-48
No files matched your search
@@ -255,7 +255,7 @@ class MemoryIdentityTestCase(_Base):
|
||||
def add_summary(self, *a, **k):
|
||||
return 99
|
||||
h = self._h(body={"goal": "g", "conclusion": "c"})
|
||||
with mock.patch("cloud.server.MemoryStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.MemoryStore", _Store):
|
||||
h._memory_create("u1", "p1")
|
||||
code, payload = self._last(h)
|
||||
self.assertEqual(code, 201)
|
||||
@@ -272,12 +272,12 @@ class MemoryIdentityTestCase(_Base):
|
||||
def build_prompt_context(self, project_id, top_k=5):
|
||||
return ""
|
||||
h = self._h()
|
||||
with mock.patch("cloud.server.MemoryStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.MemoryStore", _Store):
|
||||
h._memory_list("p1", {})
|
||||
self.assertEqual(self._last(h)[0], 200)
|
||||
|
||||
def test_memory_supersede_close_failure_swallowed(self):
|
||||
from cloud.server import MemoryStore
|
||||
from cloud.handler_identity import MemoryStore
|
||||
store = MemoryStore(self.db_path)
|
||||
try:
|
||||
mid = store.add_summary("p1", "", "g", "c")
|
||||
@@ -291,7 +291,7 @@ class MemoryIdentityTestCase(_Base):
|
||||
def deprecate(self, mid):
|
||||
pass
|
||||
h = self._h()
|
||||
with mock.patch("cloud.server.MemoryStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.MemoryStore", _Store):
|
||||
h._memory_supersede("u1", "p1", str(mid))
|
||||
code, payload = self._last(h)
|
||||
self.assertEqual(code, 200)
|
||||
@@ -344,7 +344,7 @@ class MemoryIdentityTestCase(_Base):
|
||||
def supersede_memory(self, *a, **k):
|
||||
raise KeyError("gone")
|
||||
h = self._h(body={})
|
||||
with mock.patch("cloud.server.IdentityStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.IdentityStore", _Store):
|
||||
h._identity_user_memory_supersede("u1", "m1")
|
||||
self.assertEqual(self._last(h)[0], 404)
|
||||
|
||||
@@ -359,7 +359,7 @@ class MemoryIdentityTestCase(_Base):
|
||||
def delete_memory(self, mem_id, user_id):
|
||||
raise KeyError("gone")
|
||||
h = self._h()
|
||||
with mock.patch("cloud.server.IdentityStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.IdentityStore", _Store):
|
||||
h._identity_user_memory_delete("u1", "m1")
|
||||
self.assertEqual(self._last(h)[0], 404)
|
||||
|
||||
@@ -405,7 +405,7 @@ class MemoryIdentityTestCase(_Base):
|
||||
def build_prompt_context(self, project_id):
|
||||
return ""
|
||||
h = self._h()
|
||||
with mock.patch("cloud.server.MemoryStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.MemoryStore", _Store):
|
||||
h._identity_context("u1", {"project_id": ["p1"]})
|
||||
self.assertEqual(self._last(h)[0], 200)
|
||||
|
||||
@@ -479,7 +479,7 @@ class MemoryIdentityTestCase(_Base):
|
||||
def supersede_memory(self, *a, **k):
|
||||
raise PermissionError("not yours")
|
||||
h = self._h(body={})
|
||||
with mock.patch("cloud.server.IdentityStore", _Store):
|
||||
with mock.patch("cloud.handler_identity.IdentityStore", _Store):
|
||||
h._project_identity_memory_supersede("u1", "p1", "m1")
|
||||
self.assertEqual(self._last(h)[0], 404)
|
||||
|
||||
|
||||
Reference in new issue
Block a user