def testTypeError(self): with pytest.raises(TypeError): pulsebox.ino_edge(0.1) with pytest.raises(TypeError): pulsebox.ino_edge("a") with pytest.raises(TypeError): pulsebox.ino_edge(True)
def testValueError(self): with pytest.raises(ValueError): pulsebox.ino_edge(-1) with pytest.raises(ValueError): pulsebox.ino_edge(2 ** 32)
def testValid(self): self.edge_code = pulsebox.INO_EDGE assert pulsebox.ino_edge(0) == self.edge_code.format("0b0")