def dummy(client): # set the connection lost handler client.connectionLostHandler = conn_lost_handler # trigger an operation, which should yield client.dummy_authenticate("open sesame") root_id = yield client.get_root() # lock the user: StorageUser.objects.filter(id=self.usr0.id).update(locked=True) client.make_dir(request.ROOT, root_id, u"open sesame") yield d # check we logged a warning about this. handler.assert_warning("Shutting down protocol: user locked")
def dummy(client): # set the connection lost handler client.connectionLostHandler = conn_lost_handler # trigger an operation, which should yield client.dummy_authenticate("open sesame") root_id = yield client.get_root() # lock the user: usr = self.user_store.get(model.StorageUser, 0) usr.locked = True self.user_store.commit() client.make_dir(request.ROOT, root_id, u"open sesame") yield d # check we logged a warning about this. self.assertTrue( hdlr.check_warning("Shutting down protocol: user locked"))
def dummy(client): # set the connection lost handler client.connectionLostHandler = conn_lost_handler # trigger an operation, which should yield client.dummy_authenticate("open sesame") root_id = yield client.get_root() # lock the user: usr = self.store.get(StorageUser, 0) usr.locked = True self.store.commit() client.make_dir(request.ROOT, root_id, u"open sesame") yield d # check we logged a warning about this. self.assertTrue(hdlr.check_warning( "Shutting down protocol: user locked"))