-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_create.py
More file actions
31 lines (22 loc) · 1.05 KB
/
test_create.py
File metadata and controls
31 lines (22 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pytest
from aer_plugin.plugin import Plugin
class TestCreation:
"""
Verify whether creating a plugin instance and running a job
is working correctly.
"""
def test_valid_execute_call(self):
"""should raise no error, the circuit is implemented correctly"""
Plugin().execute("aer", "./tests/valid.qasm", {}, "counts")
def test_invalid_backend(self):
"""should raise an AssertionError. The provided backend is not available"""
with pytest.raises(AssertionError):
Plugin().execute("aer2", "./tests/valid.qasm", {}, "counts")
def test_invalid_result_type(self):
"""should raise an AssertionError. The result type is invalid"""
with pytest.raises(AssertionError):
Plugin().execute("aer", "./tests/valid.qasm", {}, "countst")
def test_invalid_qasm_file_path(self):
"""should raise an AssertionError. QASM file path doesn't exists"""
with pytest.raises(AssertionError):
Plugin().execute("aer", "./tests/valid2.qasm", {}, "countst")