Skip to content

Commit b57d79d

Browse files
committed
Add test for notebook bernstein_vazirani
1 parent e7ca75b commit b57d79d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pytest
2+
from tests.utils_for_testbook import (
3+
validate_quantum_program_size,
4+
validate_quantum_model,
5+
execute_testbook_with_timeout,
6+
)
7+
from tests.utils_for_tests import should_skip_notebook
8+
from testbook.client import TestbookNotebookClient # type: ignore[import]
9+
10+
11+
@execute_testbook_with_timeout("bernstein_vazirani", timeout_seconds=20)
12+
def test_bernstein_vazirani(tb: TestbookNotebookClient) -> None:
13+
# test models
14+
validate_quantum_model(tb.ref("qmod"))
15+
# test quantum programs
16+
validate_quantum_program_size(tb.ref("qprog"), expected_width=6, expected_depth=5)
17+
18+
# test notebook content
19+
assert int(tb.ref("secret_integer_q")) == tb.ref("SECRET_INT")

0 commit comments

Comments
 (0)