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)
def test_convert_item_non_int(): h = Http() for item in ['a', [1, 2, 3]]: assert h.convert_item(item) == str(item)
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)