summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-07-14 12:31:05 +0300
committerLars Wirzenius <liw@liw.fi>2019-07-25 09:19:55 +0300
commit269c653adcdcc2e3ef32d7e311442a723f62dfc6 (patch)
treee6d18a3a4f9fc7d88a5eb65a47de050fede0fe9d
parent9ef1919463a2c40c2f6be723cc0187fdd789930e (diff)
downloadick2-269c653adcdcc2e3ef32d7e311442a723f62dfc6.tar.gz
Drop: unused PersistentState.get_resource_kinds method
-rw-r--r--ick2/persistent.py8
-rw-r--r--ick2/persistent_tests.py6
-rw-r--r--ick2/trans.py5
3 files changed, 3 insertions, 16 deletions
diff --git a/ick2/persistent.py b/ick2/persistent.py
index c5e2840..1d79e3d 100644
--- a/ick2/persistent.py
+++ b/ick2/persistent.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Lars Wirzenius
+# Copyright (C) 2018-2019 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -27,9 +27,6 @@ import ick2
class PersistentStateInterface: # pragma: no cover
- def get_resource_kinds(self):
- raise NotImplementedError()
-
def get_resource_ids(self, kind):
raise NotImplementedError()
@@ -79,9 +76,6 @@ class FilePersistentState(PersistentStateInterface):
dirname = self._dirname(kind)
return os.path.join(dirname, self._safe(rid))
- def get_resource_kinds(self):
- return self._unsafe_list(os.listdir(self._dir))
-
def has_resource(self, kind, rid):
filename = self._filename(kind, rid)
return os.path.exists(filename)
diff --git a/ick2/persistent_tests.py b/ick2/persistent_tests.py
index 8acb141..de279a1 100644
--- a/ick2/persistent_tests.py
+++ b/ick2/persistent_tests.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Lars Wirzenius
+# Copyright (C) 2018-2019 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -35,9 +35,6 @@ class FilePersistentStateTests(unittest.TestCase):
def test_returns_dirname(self):
self.assertEqual(self.state.get_directory(), self.tempdir)
- def test_has_no_resource_kinds_initially(self):
- self.assertEqual(self.state.get_resource_kinds(), [])
-
def test_has_no_resources_initially(self):
self.assertEqual(self.state.get_resource_ids('silly'), [])
@@ -50,7 +47,6 @@ class FilePersistentStateTests(unittest.TestCase):
r = ick2.resource_from_dict(as_dict)
self.state.write_resource('silly', '#1', r)
self.assertTrue(self.state.has_resource('silly', '#1'))
- self.assertEqual(self.state.get_resource_kinds(), ['silly'])
self.assertEqual(self.state.get_resource_ids('silly'), ['#1'])
r2 = self.state.get_resource('silly', '#1')
diff --git a/ick2/trans.py b/ick2/trans.py
index f1c8e5e..c5dc22f 100644
--- a/ick2/trans.py
+++ b/ick2/trans.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Lars Wirzenius
+# Copyright (C) 2018-2019 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -59,9 +59,6 @@ class TransactionalState:
raise ick2.NotFound(kind=kind, rid=rid)
return TransactionalResource(self.state, kind, rid)
- def get_resource_kinds(self):
- return self.state.get_resource_kinds()
-
def get_resource_ids(self, kind):
return self.state.get_resource_ids(kind)