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.

29 line
559B

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