소스 검색

Test graph

master
Pete Shadbolt 8 년 전
부모
커밋
375b1d73bc
2개의 변경된 파일33개의 추가작업 그리고 20개의 파일을 삭제
  1. +0
    -20
      tests/test_cz.py
  2. +33
    -0
      tests/test_graph.py

+ 0
- 20
tests/test_cz.py 파일 보기

@@ -1,23 +1,3 @@
from graph import *

def test_local_complementation():
""" Test that local complementation works as expected """
g, vops = graph()
add_edge(g, 0, 1)
add_edge(g, 0, 2)
add_edge(g, 1, 2)
add_edge(g, 0, 3)
local_complementation(g, vops, 0)
assert has_edge(g, 0, 1)
assert has_edge(g, 0, 2)
assert not has_edge(g, 1, 2)
assert has_edge(g, 3, 2)
assert has_edge(g, 3, 1)

# TODO: test VOP conditions

def test_remove_vop():
""" Test that removing VOPs really works """
pass


+ 33
- 0
tests/test_graph.py 파일 보기

@@ -16,3 +16,36 @@ def test_graph():

assert has_edge(g, 1,2)
assert not has_edge(g, 0,1)

def test_local_complementation():
""" Test that local complementation works as expected """
g, vops = graph()
add_edge(g, 0, 1)
add_edge(g, 0, 2)
add_edge(g, 1, 2)
add_edge(g, 0, 3)
local_complementation(g, vops, 0)
assert has_edge(g, 0, 1)
assert has_edge(g, 0, 2)
assert not has_edge(g, 1, 2)
assert has_edge(g, 3, 2)
assert has_edge(g, 3, 1)

# TODO: test VOP conditions

def test_remove_vop():
""" Test that removing VOPs really works """
g, vops = graph()
add_edge(g, 0, 1)
add_edge(g, 0, 2)
add_edge(g, 1, 2)
add_edge(g, 0, 3)
remove_vop(g, vops, 0, 1)
assert vops[0] == clifford.by_name["identity"]
remove_vop(g, vops, 1, 1)
assert vops[1] == clifford.by_name["identity"]
remove_vop(g, vops, 2, 1)
assert vops[2] == clifford.by_name["identity"]
remove_vop(g, vops, 0, 1)
assert vops[0] == clifford.by_name["identity"]


불러오는 중...
취소
저장