示例#1
0
def test_convert_item_ints_octal():
    h = Http()
    h.options.set_value('number_format', 'octal')
    for item in [7, 8, 15, 20]:
        assert h.convert_item(item) == oct(item)
示例#2
0
def test_convert_item_non_int():
    h = Http()
    for item in ['a', [1, 2, 3]]:
        assert h.convert_item(item) == str(item)
示例#3
0
def test_convert_item_ints_hexadecimal():
    h = Http()
    h.options.set_value('number_format', 'hexadecimal')
    for item in [7, 8, 15, 20]:
        assert h.convert_item(item) == hex(item)