예제 #1
0
def test_failing_attribute_call():
    class ImproperlyAttributed(object):
        timestamp = datetime.datetime.now()

    obj = ImproperlyAttributed()
    with pytest.raises(AttributeError):
        call_attributes(obj, FIELDS)
예제 #2
0
def test_successful_attribute_call():
    class ProperlyAttributed(object):
        started = datetime.datetime.now()

    obj = ProperlyAttributed()
    assert call_attributes(obj, FIELDS)