瀏覽代碼

Added more tests

Adam Kelly 6 年之前
父節點
當前提交
7ad739b6da
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      tests/test_state.py

+ 12 - 0
tests/test_state.py

@@ -0,0 +1,12 @@
+from qcgpu import State
+import pytest
+
+def test_state_creation():
+    # Any machine should be able to handle 14 qubits
+    for i in range(1, 15):
+        State(i)
+
+def test_state_with_no_qubits_fails():
+    with pytest.raises(Exception):
+        State(0)
+