def testValid(self): self.delay_code = pulsebox.INO_DELAY assert pulsebox.ino_delay(1, 1) == self.delay_code.format("0x1", "0x0", 1) assert pulsebox.ino_delay(0, 1) == ""
def testTypeError(self): with pytest.raises(TypeError): pulsebox.ino_delay(0.1, 1) with pytest.raises(TypeError): pulsebox.ino_delay(1, 0.1) with pytest.raises(TypeError): pulsebox.ino_delay("a", 1) with pytest.raises(TypeError): pulsebox.ino_delay(1, "a") with pytest.raises(TypeError): pulsebox.ino_delay(True, 1) with pytest.raises(TypeError): pulsebox.ino_delay(1, True)
def testValueError(self): with pytest.raises(ValueError): pulsebox.ino_delay(-1, 1) with pytest.raises(ValueError): pulsebox.ino_delay(2 ** 32, 1)