示例#1
0
def test_is_float():
    cases = [
        (42.0, True),
        (42.000101010010101010101001010101010001011100001101101011100, True),
        (42, False),
        ('42', False),
        ('42.0', False),
        ([42], False),
        ([], False),
        (None, False),
        ('', False),
        (False, False),
        (True, False),
        ]
    for inp, exp in cases:
        obs = is_float(inp)
        assert exp == obs
示例#2
0
def test_is_float():
    cases = [
        (42.0, True),
        (42.000101010010101010101001010101010001011100001101101011100, True),
        (42, False),
        ('42', False),
        ('42.0', False),
        ([42], False),
        ([], False),
        (None, False),
        ('', False),
        (False, False),
        (True, False),
    ]
    for inp, exp in cases:
        obs = is_float(inp)
        yield assert_equal, exp, obs
示例#3
0
def test_is_float():
    yield assert_true, is_float(42.0)
    yield assert_false, is_float('42.0')
示例#4
0
def test_is_float(inp, exp):
    obs = is_float(inp)
    assert exp == obs
示例#5
0
def test_is_float():
    yield assert_true, is_float(42.0)
    yield assert_false, is_float('42.0')
示例#6
0
文件: test_tools.py 项目: mitnk/xonsh
def test_is_float(inp, exp):
    obs = is_float(inp)
    assert exp == obs