Anders and Briegel in Python
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728
  1. from nose import with_setup
  2. import abp
  3. def setup():
  4. global g
  5. g = abp.GraphRegister(10)
  6. @with_setup(setup)
  7. def test_adding():
  8. g.add_edge(0,1)
  9. g.add_edge(1,2)
  10. g.toggle_edge(2,0)
  11. g.toggle_edge(2,3)
  12. g.toggle_edge(3,2)
  13. assert(len(g.edgelist()) == 3)
  14. def setup_stab():
  15. global g
  16. g = abp.GraphRegister(10)
  17. g.add_edge(0,1)
  18. g.add_edge(1,2)
  19. g.add_edge(2,0)
  20. @with_setup(setup_stab)
  21. def test_adding():
  22. s = abp.Stabilizer(g)
  23. print s