ReflectionsProjections/mm18

Write regular expressions to process test URLs

Closed this issue · 0 comments

Test URLs are needed so that we can test if the server is successfully processing information.

Format for urls.py tuples

The urls file should contain tuples of arity 4 and form:

  • Regex that describes the URL to grab
  • Request_type that says GET or POST
  • Function in game_controller to pass out to

(regex, request_type, function)

Examples

(r'towers/(?P\d+)/upgrade, POST, update_object) # Note how the '?P' pulls the number out with name 'id'
(r'towers', GET, retrieve_object_list)