def test_deleteNode(self):
        class TestNode:
            nodeIdentifier = 'to-be-deleted'
            def getAffiliation(self, entity):
                if entity.userhostJID() == OWNER:
                    return defer.succeed('owner')

        class TestStorage:
            def __init__(self):
                self.deleteCalled = []

            def getNode(self, nodeIdentifier):
                return defer.succeed(TestNode())

            def deleteNode(self, nodeIdentifier):
                if ['to-be-deleted'] in nodeIdentifier:
                    self.deleteCalled.append(nodeIdentifier)
                    return defer.succeed(None)
                else:
                    return defer.fail(error.NodeNotFound())

        def preDelete(data):
            self.assertFalse(self.storage.deleteCalled)
            preDeleteCalled.append(data)
            return defer.succeed(None)

        def cb(result):
            self.assertEquals(1, len(preDeleteCalled))
            data = preDeleteCalled[-1]
            self.assertEquals('to-be-deleted', data['nodeIdentifier'])
            self.assertTrue(self.storage.deleteCalled)

        self.storage = TestStorage()
        self.backend = backend.BackendService(self.storage)

        preDeleteCalled = []

        self.backend.registerPreDelete(preDelete)
        d = self.backend.deleteNode('to-be-deleted', OWNER_FULL)
        d.addCallback(cb)
        return d
dataset/ETHPy150Open ralphm/idavoll/idavoll/test/test_backend.py/BackendTest.test_deleteNode/swapped operands of `in`