Implement filter state per sync item

This commit is contained in:
lash
2022-03-17 19:36:27 +00:00
parent 9386b9e7f9
commit 5968a19042
4 changed files with 41 additions and 35 deletions

View File

@@ -60,11 +60,7 @@ class TestSync(unittest.TestCase):
def test_basic(self):
store = MockStore(6)
state = SyncState(store)
session = SyncSession(None, state)
self.assertTrue(session.is_default)
session = SyncSession(None, state, session_id='foo')
self.assertFalse(session.is_default)
session = SyncSession(state)
def test_sum(self):
@@ -91,7 +87,7 @@ class TestSync(unittest.TestCase):
def test_session_start(self):
store = MockStore(6)
state = SyncState(store)
session = SyncSession(None, state)
session = SyncSession(state)
session.start()

View File

@@ -65,5 +65,12 @@ class TestFs(unittest.TestCase):
self.assertFalse(store.first)
def test_store_resume(self):
store = SyncFsStore(self.path)
store.start(13)
self.assertTrue(store.first)
if __name__ == '__main__':
unittest.main()