from timeutil import Clock
from datetime import datetime


class ClockStub(Clock):
    def __init__(self, now=None, utc_now=None):
        # type: (datetime, datetime) -> None
        self.now_value = now
        self.utc_now_value = utc_now

    def now(self):
        return self.now_value

    def utc_now(self):
        if self.utc_now_value is not None:
            return self.utc_now_value
        else:
            return self.now_value
