Anders and Briegel in Python
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

test_json.py 478B

1234567891011121314151617181920212223242526
  1. from abp.graph import GraphState, DiffedGraphState
  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 "ngbh" in js
  19. assert "vops" in js
  20. json.loads(js)