def test_preDeleteRedirect(self):
        """
        Test pre-delete sending out notifications to subscribers.
        """

        uri = (SERVICE.full(),) % 'xmpp:%s?;node=test2'

        class TestBackend(BaseTestBackend):
            preDeleteFn = None

            def registerPreDelete(self, preDeleteFn):
                self.preDeleteFn = preDeleteFn

            def getSubscribers(self, nodeIdentifier):
                return defer.succeed([OWNER])

        def notifyDelete(service, nodeIdentifier, subscribers,
                         redirectURI=None):
            self.assertEqual(SERVICE, service)
            self.assertEqual('test', nodeIdentifier)
            self.assertEqual([OWNER], subscribers)
            self.assertEqual(uri, redirectURI)
            d1.callback(None)

        d1 = defer.Deferred()
        resource = backend.PubSubResourceFromBackend(TestBackend())
        resource.serviceJID = SERVICE
        resource.pubsubService = pubsub.PubSubService()
        resource.pubsubService.notifyDelete = notifyDelete
        self.assertTrue(verifyObject(iwokkel.IPubSubResource, resource))
        self.assertNotIdentical(None, resource.backend.preDeleteFn)
        data = {'nodeIdentifier': 'test',
                'redirectURI': uri}
        d2 = resource.backend.preDeleteFn(data)
        return defer.DeferredList([d1, d2], fireOnOneErrback=1)
dataset/ETHPy150Open ralphm/idavoll/idavoll/test/test_backend.py/PubSubResourceFromBackendTest.test_preDeleteRedirect/swapped operands of `%`