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

27 行
536B

  1. """
  2. Makes a dummy post to the test server
  3. """
  4. import requests
  5. import json
  6. import abp
  7. import random
  8. #URL = "http://localhost:5000"
  9. URL = "https://abv.peteshadbolt.co.uk/"
  10. def test_graph():
  11. N = 50
  12. g = abp.NXGraphState(range(N))
  13. for i in range(N):
  14. g.act_cz(random.randint(0, N-1), random.randint(0, N-1))
  15. g.layout()
  16. return g
  17. if __name__ == '__main__':
  18. data = json.dumps(test_graph().to_json(stringify=False))
  19. r = requests.post("{}/graph".format(URL), data=data)
  20. print r.status_code, r.content