def test_type_invalid_4(self, not_an_int: Any) -> None: circuit = Circuit(1) try: circuit.is_point_in_range((0, not_an_int)) except TypeError: return except BaseException: assert False, 'Unexpected Exception.'
def test_type_valid_4(self, an_int: int) -> None: circuit = Circuit(4, [2, 2, 3, 3]) try: circuit.is_point_in_range(CircuitPoint(an_int, an_int)) except TypeError: assert False, 'Unexpected TypeError.' except BaseException: return
def test_return_type(self, an_int: int) -> None: circuit = Circuit(4, [2, 2, 3, 3]) assert isinstance( circuit.is_point_in_range( (an_int, an_int), ), (bool, np.bool_), )
def test_false_pos(self, point: CircuitPointLike) -> None: circuit = Circuit(5) for i in range(5): circuit.append_gate(HGate(), [0]) circuit.append_gate(HGate(), [1]) circuit.append_gate(HGate(), [2]) circuit.append_gate(HGate(), [3]) circuit.append_gate(HGate(), [4]) assert not circuit.is_point_in_range(point)