WIP selective state sync
This commit is contained in:
@@ -7,6 +7,7 @@ from shep import State
|
||||
from shep.error import (
|
||||
StateExists,
|
||||
StateInvalid,
|
||||
StateItemNotFound,
|
||||
)
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
@@ -250,5 +251,24 @@ class TestState(unittest.TestCase):
|
||||
self.assertEqual(mask, states.ALL)
|
||||
|
||||
|
||||
def test_remove(self):
|
||||
states = State(1)
|
||||
states.add('foo')
|
||||
|
||||
states.put('xyzzy', contents='plugh')
|
||||
v = states.get('xyzzy')
|
||||
self.assertEqual(v, 'plugh')
|
||||
|
||||
states.next('xyzzy')
|
||||
|
||||
v = states.state('xyzzy')
|
||||
self.assertEqual(states.FOO, v)
|
||||
|
||||
states.purge('xyzzy')
|
||||
|
||||
with self.assertRaises(StateItemNotFound):
|
||||
states.state('xyzzy')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user