From 269c653adcdcc2e3ef32d7e311442a723f62dfc6 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 14 Jul 2019 12:31:05 +0300 Subject: Drop: unused PersistentState.get_resource_kinds method --- ick2/persistent.py | 8 +------- ick2/persistent_tests.py | 6 +----- ick2/trans.py | 5 +---- 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) -- cgit v1.2.1