Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def testValueError(self):
     with pytest.raises(ValueError):
         pulsebox.ino_edge(-1)
     with pytest.raises(ValueError):
         pulsebox.ino_edge(2 ** 32)
Exemplo n.º 3
0
 def testValid(self):
     self.edge_code = pulsebox.INO_EDGE
     assert pulsebox.ino_edge(0) == self.edge_code.format("0b0")