Fix asyncnotifier unit tests
authorIustin Pop <iustin@google.com>
Tue, 21 Feb 2012 08:36:04 +0000 (09:36 +0100)
committerIustin Pop <iustin@google.com>
Tue, 21 Feb 2012 14:34:12 +0000 (15:34 +0100)
commit0f85ebd9d89097d2f70f301c0b800b7ae8e433e8
tree6e32aa6a3c87ef07cd5c53d911af28a011fa39e1
parent3bd0f3d8eb82a890d24653fa237c197aa2a3c825
Fix asyncnotifier unit tests

On my workstation, if I run the following two tests in this exact
order:

- TestSingleFileEventHandler.testError
- TestSingleFileEventHandler.testReplace

the second test will fail, because there is no "unregister" of
previous tests (and the poll() done by asyncore will fire on the
previous files which are now removed, etc. etc.).

While investigating this, I realised that we don't do any cleanup of
the various handlers/notifiers we setup for this test, so if we simply
add a proper cleanup, the tests will work nicely (in any order :).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>
test/ganeti.asyncnotifier_unittest.py