示例#1
0
def test_boolean():
    assert utils.boolean('true')
    assert utils.boolean('True')
    assert utils.boolean('TRUE')
    assert not utils.boolean('false')
    assert not utils.boolean('False')
    assert not utils.boolean('FALSE')

    with pytest.raises(ValueError):
        utils.boolean('foo')

    with pytest.raises(ValueError):
        utils.boolean(None)
示例#2
0
def test_boolean():
    assert utils.boolean("true")
    assert utils.boolean("True")
    assert utils.boolean("TRUE")
    assert not utils.boolean("false")
    assert not utils.boolean("False")
    assert not utils.boolean("FALSE")

    with pytest.raises(ValueError):
        utils.boolean("foo")

    with pytest.raises(ValueError):
        utils.boolean(None)
示例#3
0
def test_boolean():
    assert utils.boolean('true')
    assert not utils.boolean('false')
示例#4
0
def test_boolean():
    assert utils.boolean('true')
    assert utils.boolean('True')
    assert utils.boolean('TRUE')
    assert utils.boolean(True)
    assert not utils.boolean('false')
    assert not utils.boolean('False')
    assert not utils.boolean('FALSE')
    assert not utils.boolean(False)

    with pytest.raises(ValueError):
        utils.boolean('foo')

    with pytest.raises(ValueError):
        utils.boolean(None)