piknik

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README | LICENSE

commit a0e86a951adbe862c48edca9a1b4fdc02fab08c5
parent 4c163f9e788ab323537df60336f54a471b68636e
Author: lash <dev@holbrook.no>
Date:   Mon,  7 Nov 2022 08:29:33 +0000

Add proposed state

Diffstat:
Mpiknik/basket.py | 3++-
Mpiknik/store/__init__.py | 2+-
Mtests/test_basic.py | 14+++++++++++---
3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/piknik/basket.py b/piknik/basket.py @@ -10,7 +10,8 @@ class Basket: def __init__(self, state_factory): self.no_resurrect = True - self.state = state_factory.create_states(default_state='backlog', verifier=self.__check_resurrect) + self.state = state_factory.create_states(default_state='proposed', verifier=self.__check_resurrect) + self.state.add('backlog') self.state.add('pending') self.state.add('doing') self.state.add('review') diff --git a/piknik/store/__init__.py b/piknik/store/__init__.py @@ -14,7 +14,7 @@ class FileStoreFactory: def create_states(self, logger=None, default_state=None, verifier=None): factory = SimpleFileStoreFactory(self.directory).add - return PersistedState(factory, 6, logger=logger, verifier=verifier, default_state=default_state) + return PersistedState(factory, 7, logger=logger, verifier=verifier, default_state=default_state) def create_tags(self, logger=None, default_state=None, verifier=None): diff --git a/tests/test_basic.py b/tests/test_basic.py @@ -39,7 +39,7 @@ class TestBasic(unittest.TestCase): self.b.add(o) o = Issue('The second issue') self.b.add(o) - r = self.b.list('backlog') + r = self.b.list('proposed') self.assertEqual(len(r), 2) @@ -50,6 +50,7 @@ class TestBasic(unittest.TestCase): self.b.advance(v) self.b.advance(v) self.b.advance(v) + self.b.advance(v) with self.assertRaises(DeadIssue): self.b.advance(v) @@ -58,9 +59,15 @@ class TestBasic(unittest.TestCase): o = Issue('The first issue') v = self.b.add(o) o_two = Issue('The second issue') - self.b.add(o_two) + v_two = self.b.add(o_two) + self.b.advance(v_two) + o_three = Issue('The second issue') + self.b.add(o_three) self.b.state_doing(v) + r = self.b.list('proposed') + self.assertEqual(len(r), 1) + r = self.b.list('backlog') self.assertEqual(len(r), 1) @@ -89,6 +96,7 @@ class TestBasic(unittest.TestCase): o = Issue('The first issue') v = self.b.add(o) self.b.advance(v) + self.b.advance(v) self.b.block(v) self.assertIn(v, self.b.blocked()) self.b.advance(v) @@ -105,7 +113,7 @@ class TestBasic(unittest.TestCase): def test_states_list(self): r = self.b.states() - self.assertEqual(len(r), 6) + self.assertEqual(len(r), 7) if __name__ == '__main__':