Mercurial > libervia-pubsub
comparison idavoll/test/test_backend.py @ 157:21fcfb86433f
Fix tests to work with current Twisted. Really do 0.5.0 release.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Mon, 28 Aug 2006 12:48:45 +0000 |
parents | 5191ba7c4df8 |
children | ef22e4150caa |
comparison
equal
deleted
inserted
replaced
156:6250905b72f6 | 157:21fcfb86433f |
---|---|
1 # Copyright (c) 2003-2006 Ralph Meijer | 1 # Copyright (c) 2003-2006 Ralph Meijer |
2 # See LICENSE for details. | 2 # See LICENSE for details. |
3 | 3 |
4 from twisted.trial import unittest | 4 from twisted.trial import unittest |
5 from twisted.trial.assertions import * | |
6 from zope.interface import implements | 5 from zope.interface import implements |
7 from twisted.internet import defer | 6 from twisted.internet import defer |
8 from twisted.words.protocols.jabber import jid | 7 from twisted.words.protocols.jabber import jid |
9 | 8 |
10 from idavoll import backend, storage | 9 from idavoll import backend, storage |
43 def pre_delete(node_id): | 42 def pre_delete(node_id): |
44 self.pre_delete_called = True | 43 self.pre_delete_called = True |
45 return defer.succeed(None) | 44 return defer.succeed(None) |
46 | 45 |
47 def cb(result): | 46 def cb(result): |
48 assert_(self.pre_delete_called) | 47 self.assert_(self.pre_delete_called) |
49 assert_(self.delete_called) | 48 self.assert_(self.delete_called) |
50 | 49 |
51 self.backend.register_pre_delete(pre_delete) | 50 self.backend.register_pre_delete(pre_delete) |
52 d = self.backend.delete_node('to-be-deleted', OWNER) | 51 d = self.backend.delete_node('to-be-deleted', OWNER) |
53 d.addCallback(cb) | 52 d.addCallback(cb) |
54 | 53 |