示例#1
0
def test_hex_bad():
    """
    Verify output of odx with bad hex input
    """
    pytest.debug_func()
    exp = "invalid literal for int() with base 16"
    with pytest.raises(ValueError) as err:
        odx.odx("0x5234g7")
    assert exp in str(err)
示例#2
0
def test_octal_bad():
    """
    Verify output of odx with bad octal input
    """
    pytest.debug_func()
    exp = "invalid literal for int() with base 8"
    with pytest.raises(ValueError) as err:
        odx.odx("0987")
    assert exp in str(err)
示例#3
0
def test_hex_good():
    """
    Verify output of odx with good hex input
    """
    pytest.debug_func()
    exp = "0x1f1f -> 017437 / 7967 / 0x1f1f"
    assert exp == odx.odx("0x1f1f")
示例#4
0
def test_octal_good():
    """
    Verify output of odx with good octal input
    """
    pytest.debug_func()
    exp = "0124 -> 0124 / 84 / 0x54"
    assert exp == odx.odx('0124')
示例#5
0
def test_decimal_good():
    """
    Verify output of odx with good decimal input
    """
    pytest.debug_func()
    exp = "25 -> 031 / 25 / 0x19"
    assert exp == odx.odx('25')
示例#6
0
 def test_hex_good(self):
     """
     Verify output of odx with good hex input
     """
     exp = "0x1f1f -> 017437 / 7967 / 0x1f1f"
     self.expgot(exp, odx.odx("0x1f1f"))
示例#7
0
 def test_octal_good(self):
     """
     Verify output of odx with good octal input
     """
     exp = "0124 -> 0124 / 84 / 0x54"
     self.expgot(exp, odx.odx("0124"))
示例#8
0
 def test_decimal_good(self):
     """
     Verify output of odx with good decimal input
     """
     exp = "25 -> 031 / 25 / 0x19"
     self.expgot(exp, odx.odx("25"))