Anders and Briegel in Python
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

27 rindas
465B

  1. from abp.graphstate import GraphState
  2. from abp import clifford
  3. import time
  4. import json
  5. def demograph():
  6. """ A graph for testing with """
  7. g = GraphState()
  8. g.add_edge(0, 1)
  9. g.add_edge(1, 2)
  10. g.add_edge(2, 0)
  11. g.add_edge(0, 3)
  12. g.add_edge(100, 200)
  13. return g
  14. def test_json_basic():
  15. """ Test that we can export to JSON """
  16. g = demograph()
  17. js = g.to_json()
  18. assert "edge" in js
  19. assert "vops" in js
  20. json.loads(js)