Binary content option, sync all option
This commit is contained in:
@@ -142,7 +142,7 @@ class TestStateReport(unittest.TestCase):
|
||||
os.stat(fp)
|
||||
|
||||
|
||||
def test_sync(self):
|
||||
def test_sync_one(self):
|
||||
self.states.put('abcd', state=self.states.FOO, contents='foo')
|
||||
self.states.put('xxx', state=self.states.FOO)
|
||||
self.states.put('yyy', state=self.states.FOO)
|
||||
@@ -162,6 +162,25 @@ class TestStateReport(unittest.TestCase):
|
||||
self.assertEqual(self.states.get('zzzz'), 'xyzzy')
|
||||
|
||||
|
||||
def test_sync_all(self):
|
||||
self.states.put('abcd', state=self.states.FOO)
|
||||
self.states.put('xxx', state=self.states.BAR)
|
||||
|
||||
fp = os.path.join(self.d, 'FOO', 'abcd')
|
||||
f = open(fp, 'w')
|
||||
f.write('foofoo')
|
||||
f.close()
|
||||
|
||||
fp = os.path.join(self.d, 'BAR', 'zzzz')
|
||||
f = open(fp, 'w')
|
||||
f.write('barbar')
|
||||
f.close()
|
||||
|
||||
self.states.sync()
|
||||
self.assertEqual(self.states.get('abcd'), None)
|
||||
self.assertEqual(self.states.get('zzzz'), 'barbar')
|
||||
|
||||
|
||||
def test_path(self):
|
||||
self.states.put('yyy', state=self.states.FOO)
|
||||
|
||||
|
||||
@@ -80,5 +80,6 @@ class TestStateItems(unittest.TestCase):
|
||||
self.assertIsNone(self.mockstore.v.get(item))
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user