Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

        def freeze_time(time_to_freeze, tz_offset=0):
    if isinstance(time_to_freeze, datetime.datetime):
        time_to_freeze = time_to_freeze.isoformat()
    elif isinstance(time_to_freeze, datetime.date):
        time_to_freeze = time_to_freeze.isoformat()

    # Python3 doesn't have basestring, but it does have str.
    try:
        string_type = basestring
    except NameError:
        string_type = str

    if not isinstance(time_to_freeze, string_type):
        raise TypeError(('freeze_time() expected a string, date instance, or '
                         'datetime instance, but got type {0}.').format(type(time_to_freeze)))

    return _freeze_time(time_to_freeze, tz_offset)
        


src/f/r/freezegun-0.1.16/freezegun/__init__.py   freezegun(Download)
__copyright__ = 'Copyright 2012 Steve Pulec'
 
from .api import freeze_time
 
__all__ = ["freeze_time"]

src/f/r/freezegun-HEAD/freezegun/__init__.py   freezegun(Download)
__copyright__ = 'Copyright 2012 Steve Pulec'
 
from .api import freeze_time
 
__all__ = ["freeze_time"]