コード例 #1
0
ファイル: test_pulsebox.py プロジェクト: rhosak/pulsebox
 def testTypeError(self):
     with pytest.raises(TypeError):
         pulsebox.hex_split(0.1)
     with pytest.raises(TypeError):
         pulsebox.hex_split("a")
     with pytest.raises(TypeError):
         pulsebox.hex_split(True)
コード例 #2
0
ファイル: test_pulsebox.py プロジェクト: rhosak/pulsebox
 def testValueError(self):
     with pytest.raises(ValueError):
         pulsebox.hex_split(-1)
     with pytest.raises(ValueError):
         pulsebox.hex_split(2 ** 32)
コード例 #3
0
ファイル: test_pulsebox.py プロジェクト: rhosak/pulsebox
 def testSmall(self):
     assert pulsebox.hex_split(15) == ("0x0", "0xf")
     assert pulsebox.hex_split(255) == ("0x0", "0xff")
     assert pulsebox.hex_split(4095) == ("0x0", "0xfff")
     assert pulsebox.hex_split(65535) == ("0x0", "0xffff")
コード例 #4
0
ファイル: test_pulsebox.py プロジェクト: rhosak/pulsebox
 def testLarge(self):
     assert pulsebox.hex_split(65536) == ("0x1", "0x0")
     assert pulsebox.hex_split(1048575) == ("0xf", "0xffff")
     assert pulsebox.hex_split(16777215) == ("0xff", "0xffff")
     assert pulsebox.hex_split(268435455) == ("0xfff", "0xffff")
     assert pulsebox.hex_split(4294967295) == ("0xffff", "0xffff")
コード例 #5
0
ファイル: test_pulsebox.py プロジェクト: rhosak/pulsebox
 def testZero(self):
     assert pulsebox.hex_split(0) == ("0x0", "0x0")