Ejemplo n.º 1
0
def test_tz_class():
    tzi = rdt.TzClass()

    dt = pdt.datetime(2018, 1, 1, tzinfo=tzi)

    assert dt.tzname() == "+01:00"
    assert dt.utcoffset() == pdt.timedelta(hours=1)
    assert dt.dst() is None
Ejemplo n.º 2
0
def test_tz_class_introspection():
    tzi = rdt.TzClass()

    assert tzi.__class__ == rdt.TzClass
    assert repr(tzi).startswith("<TzClass object at")
Ejemplo n.º 3
0
def test_tz_class_introspection():
    tzi = rdt.TzClass()

    assert tzi.__class__ == rdt.TzClass
    assert repr(tzi).startswith("<rustapi_module.datetime.TzClass object at")
Ejemplo n.º 4
0
def test_tz_class_introspection():
    tzi = rdt.TzClass()

    assert tzi.__class__ == rdt.TzClass
    # PyPy generates <importlib.bootstrap.TzClass ...> for some reason.
    assert re.match(r"^<[\w\.]*TzClass object at", repr(tzi))