def test_concatenate_circuits_python_objects(self, circuit_set): # Given expected_concatenated_circuit_filename = "result-circuit.json" expected_concatenated_circuit = Circuit() for circuit in copy.deepcopy(circuit_set): expected_concatenated_circuit += circuit # When concatenate_circuits(circuit_set) # Then try: concatenated_circuit = load_circuit(expected_concatenated_circuit_filename) assert concatenated_circuit.gates == expected_concatenated_circuit.gates finally: remove_file_if_exists(expected_concatenated_circuit_filename)
def test_concatenate_circuits_python_objects(self, circuit_set): # Given expected_concatenated_circuit_filename = "result-circuit.json" expected_concatenated_circuit = sum( [circuit for circuit in circuit_set], new_circuits.Circuit()) # When concatenate_circuits(circuit_set) # Then try: with open(expected_concatenated_circuit_filename) as f: concatenated_circuit = new_circuits.circuit_from_dict( json.load(f)) assert concatenated_circuit == expected_concatenated_circuit finally: remove_file_if_exists(expected_concatenated_circuit_filename)