Simulate graph states in the browser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
1234567891011121314151617181920212223242526
  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 = 10
  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