Skip to content

Commit

Permalink
Adds error msg test when body is malformed
Browse files Browse the repository at this point in the history
  • Loading branch information
y4izus committed Jul 15, 2024
1 parent c1c445e commit 3d2cae0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_transpiler_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def test_transpile_wrong_backend(backend_name):


def test_transpile_exceed_circuit_size():

circuit = EfficientSU2(100, entanglement="circular", reps=50).decompose()
transpiler_service = TranspilerService(
backend_name="ibm_kyoto",
Expand All @@ -202,6 +201,25 @@ def test_transpile_exceed_circuit_size():
)


def test_transpile_malformed_body():
circuit = EfficientSU2(100, entanglement="circular", reps=1).decompose()
transpiler_service = TranspilerService(
backend_name="ibm_kyoto",
ai="false",
optimization_level=3,
qiskit_transpile_options={ "failing_option": 0 }
)

try:
transpiler_service.run(circuit)
pytest.fail("Error expected")
except Exception as e:
assert (
str(e)
== '"transpile() got an unexpected keyword argument \'failing_option\'"'
)


def compare_layouts(plugin_circ, non_ai_circ):
assert (
plugin_circ.layout.initial_layout == non_ai_circ.layout.initial_layout
Expand Down

0 comments on commit 3d2cae0

Please sign in to comment.