Пример #1
0
def test_that_you_cant_find_out_when_somewhen_is_from_attributes(attribute):
    with pytest.raises(RuntimeError):
        getattr(Somewhen(), attribute)
Пример #2
0
def test_somewhen_is_on_some_date():
    assert (Somewhen()).date() is Somedate()
Пример #3
0
def test_it_looks_appropriate_as_a_string():
    assert str(Somewhen()) == "somewhen :shrug:"
Пример #4
0
def test_it_looks_appropriate_as_a_repr():
    assert repr(Somewhen()) == "Somewhen()"
Пример #5
0
def test_a_day_after_somewhen_is_somewhen():
    assert (Somewhen() + datetime.timedelta(days=1)) == Somewhen()
Пример #6
0
def test_a_day_before_somewhen_is_somewhen():
    assert (Somewhen() - datetime.timedelta(days=1)) == Somewhen()
Пример #7
0
def test_somewhen_is_less_than_or_equal_to_itself_though():
    assert Somewhen() >= Somewhen()
Пример #8
0
def test_somewhen_is_exactly_the_same_as_any_other_somewhen():
    assert Somewhen() is Somewhen()
Пример #9
0
def test_somewhen_is_never_the_same_as_a_specific_date():
    some_date = datetime.datetime(year=2000, month=1, day=1, hour=1, minute=1, second=1, microsecond=0, tzinfo=None)
    assert Somewhen() != some_date
Пример #10
0
def test_somewhen_is_not_before_a_date():
    the_past = datetime.datetime.now() - datetime.timedelta(days=1)
    assert not the_past > Somewhen()
Пример #11
0
def test_deep_copying_somewhen_is_still_somewhen():
    assert deepcopy(Somewhen()) is Somewhen()
Пример #12
0
def test_copying_somewhen_is_still_somewhen():
    assert copy(Somewhen()) is Somewhen()
Пример #13
0
def test_somewhen_is_equally_to_somewhen():
    assert Somewhen() == Somewhen()
Пример #14
0
def test_somewhen_is_a_datetime():
    assert isinstance(Somewhen(), datetime.datetime)
Пример #15
0
def test_somewhen_is_also_greater_than_or_equal_to_itself_though():
    assert Somewhen() <= Somewhen()
Пример #16
0
def test_somewhen_is_at_some_time():
    assert (Somewhen()).time() is Sometime()
Пример #17
0
def test_somewhen_is_a_somewhen():
    assert isinstance(Somewhen(), Somewhen)