예제 #1
0
def test_predicates_01():

    assert predicates.is_boolean(True)
    assert predicates.is_boolean(False)

    assert not predicates.is_boolean(None)
    assert not predicates.is_boolean('')
    assert not predicates.is_boolean(0)
    assert not predicates.is_boolean(1)
예제 #2
0
def test_predicates_02():

    assert predicates.is_identifier('foo_bar')
    assert predicates.is_identifier('FooBar')
    assert predicates.is_identifier('_foo_bar')
    assert predicates.is_identifier('__foo_bar')
    assert predicates.is_identifier('_')
    assert predicates.is_identifier('f')

    assert not predicates.is_boolean(None)
    assert not predicates.is_boolean('')
    assert not predicates.is_boolean('1')
    assert not predicates.is_boolean('foo_!')
    assert not predicates.is_boolean('foo_#')
    assert not predicates.is_boolean('foo_@')