示例#1
0
def test_is_int_int():
    ## GIVEN a string with a int
    a = "4"
    ## WHEN checking if int
    res = isint(a)
    ## THEN assert it is a int
    assert res is True
示例#2
0
def test_is_int_tricky():
    ## GIVEN a string with a empty string
    a = "1.0"
    ## WHEN checking if integer
    res = isint(a)
    ## THEN assert it is not a integer
    assert res is True
示例#3
0
def test_is_int_float():
    ## GIVEN a string with a float
    a = "1.2"
    ## WHEN checking if integer
    res = isint(a)
    ## THEN assert it is not a integer
    assert res is False