blob: c38009e3de161acaedcf9f1ba07ec2e12016d73b [file] [log] [blame]
# coding=utf8
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A verifier that does nothing."""
from verification import base
class FakeVerifier(base.Verifier):
name = 'fake'
def __init__(self, state):
super(FakeVerifier, self).__init__()
self.state = state
def verify(self, pending):
pending.verifications[self.name] = base.SimpleStatus(self.state)
def update_status(self, queue):
pass
class DeferredFakeVerifier(base.Verifier):
name = 'fake'
def __init__(self, state, delay):
super(DeferredFakeVerifier, self).__init__()
self.state = state
self.delay = delay
def verify(self, pending):
pending.verifications[self.name] = base.SimpleStatus()
def update_status(self, queue):
if self.delay:
self.delay -= 1
return
for _, fake in self.loop(queue, base.SimpleStatus, True):
fake.state = self.state