cc-4228: fixed this ticket by stomping out bugs in eventcontractor and tweaking ApiController

This commit is contained in:
Rudi Grinberg 2012-08-17 12:37:26 -04:00
parent 10a7eae498
commit 5b134d0055
6 changed files with 40 additions and 14 deletions

View file

@ -49,4 +49,22 @@ class TestMMP(unittest.TestCase):
self.assertTrue( ev.register(e3) )
self.assertTrue( ev.register(e2) )
def test_register2(self):
ev = EventContractor()
p = 'bullshit.mp3'
events = [
NewFile( FakePyinotify(p) ),
NewFile( FakePyinotify(p) ),
DeleteFile( FakePyinotify(p) ),
NewFile( FakePyinotify(p) ),
NewFile( FakePyinotify(p) ), ]
actual_events = []
for e in events:
if ev.register(e):
actual_events.append(e)
self.assertEqual( len(ev.store.keys()), 1 )
packed = [ x.safe_pack() for x in actual_events ]
print(packed)
if __name__ == '__main__': unittest.main()