summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-10-18 10:49:32 +0300
committerLars Wirzenius <liw@liw.fi>2019-10-18 10:49:32 +0300
commit540b55836a7eff3de13acfb54712fa931a8b4a52 (patch)
treef5fd5b9be0ce316c35ad5876c925e148029474e0
parentb10fd29010dfc935a342494e193a0e4ffe02a387 (diff)
downloadick2-540b55836a7eff3de13acfb54712fa931a8b4a52.tar.gz
Revert "Add: update_resource"
This reverts commit 80539a84aaa17aca1da9c56794e41a114e222041.
-rw-r--r--ick2/persistent.py9
-rw-r--r--ick2/persistent_tests.py18
2 files changed, 0 insertions, 27 deletions
diff --git a/ick2/persistent.py b/ick2/persistent.py
index d323db7..d865207 100644
--- a/ick2/persistent.py
+++ b/ick2/persistent.py
@@ -45,9 +45,6 @@ class PersistentStateInterface: # pragma: no cover
def write_resource(self, token, kind, rid, resource):
raise NotImplementedError()
- def update_resource(self, token, kind, rid, resource):
- raise NotImplementedError()
-
def remove_resource(self, token, kind, rid):
raise NotImplementedError()
@@ -75,9 +72,6 @@ class MemoryPersistentState(PersistentStateInterface):
self._res[kind] = {}
self._res[kind][rid] = resource
- def update_resource(self, token, kind, rid, resource):
- self.write_resource(token, kind, rid, resource)
-
def remove_resource(self, token, kind, rid):
if kind not in self._res or rid not in self._res[kind]:
raise ick2.NotFound(kind=kind, rid=rid)
@@ -107,9 +101,6 @@ class MuckPersistentState(PersistentStateInterface):
self._res[kind] = {}
self._res[kind][rid] = resource
- def update_resource(self, token, kind, rid, resource):
- self.write_resource(token, kind, rid, resource)
-
def remove_resource(self, token, kind, rid):
if kind not in self._res or rid not in self._res[kind]:
raise ick2.NotFound(kind=kind, rid=rid)
diff --git a/ick2/persistent_tests.py b/ick2/persistent_tests.py
index 8406acf..802ca8b 100644
--- a/ick2/persistent_tests.py
+++ b/ick2/persistent_tests.py
@@ -49,24 +49,6 @@ class PersistentStateTestsMixIn:
self.assertTrue(isinstance(r2, ick2.Resource))
self.assertEqual(r.as_dict(), r2.as_dict())
- def test_updates_resource(self):
- as_dict = {'foo': 'bar'}
- r = ick2.resource_from_dict(as_dict)
-
- as_dict = {'foo': 'yo'}
- r2 = ick2.resource_from_dict(as_dict)
-
- token = self.get_token()
- self.state.write_resource(token, 'silly', '#1', r)
- self.state.update_resource(token, 'silly', '#1', r2)
-
- self.assertTrue(self.state.has_resource(token, 'silly', '#1'))
- self.assertEqual(self.state.get_resource_ids(token, 'silly'), ['#1'])
-
- actual = self.state.get_resource(token, 'silly', '#1')
- self.assertTrue(isinstance(actual, ick2.Resource))
- self.assertEqual(actual.as_dict(), r2.as_dict())
-
def test_removes_resource(self):
as_dict = {'foo': 'bar'}
r = ick2.resource_from_dict(as_dict)