コード例 #1
0
ファイル: test_configure.py プロジェクト: ccpgames/pypackage
def test_coerce__to_str(value, expected):
    """Ensure we coerce to str."""

    assert configure.coerce_to_expected(value, "foo", str) == expected
コード例 #2
0
ファイル: test_configure.py プロジェクト: ccpgames/pypackage
def test_coerce__to_bool(value, expected):
    """Ensure we are properly coercing to boolean."""

    assert configure.coerce_to_expected(value, "foo", bool) is expected
コード例 #3
0
ファイル: test_configure.py プロジェクト: ccpgames/pypackage
def test_coerce__no_value(value):
    """If the value fails a truthyness test, it should be returned."""

    assert configure.coerce_to_expected(value, "foo", str) == value
コード例 #4
0
ファイル: test_configure.py プロジェクト: Zearin/pypackage
def test_coerce__to_str(value, expected):
    """Ensure we coerce to str."""

    assert configure.coerce_to_expected(value, "foo", str) == expected
コード例 #5
0
ファイル: test_configure.py プロジェクト: Zearin/pypackage
def test_coerce__to_bool(value, expected):
    """Ensure we are properly coercing to boolean."""

    assert configure.coerce_to_expected(value, "foo", bool) is expected
コード例 #6
0
ファイル: test_configure.py プロジェクト: Zearin/pypackage
def test_coerce__no_value(value):
    """If the value fails a truthyness test, it should be returned."""

    assert configure.coerce_to_expected(value, "foo", str) == value