Skip to content

Instantly share code, notes, and snippets.

@abought
Created September 2, 2015 21:58
Show Gist options
  • Save abought/3a78b86e9d3ce615e2ed to your computer and use it in GitHub Desktop.
Save abought/3a78b86e9d3ce615e2ed to your computer and use it in GitHub Desktop.
"""
A script to demonstrate how a particular function behaves with different inputs and outputs
"""
from website.util import api_v2_url
SCENARIOS = [
('http://localhost:8000/', ''),
('http://localhost:8000/', 'v2/'),
('https://staging.osf.io/', 'api/v2'),
('https://staging2.osf.io/', 'v2'),
('https://api.staging.osf.io/', ''),
('https://api.staging.osf.io/', 'v2/')
]
ENDPOINT = "/users/4urxt/nodes/"
for scenario in SCENARIOS:
base_route, base_prefix = scenario
print "Called api_v2_url with arguments path_str='{}', base_route='{}', base_prefix='{}'".format(ENDPOINT, base_route, base_prefix)
print "\t Result:", api_v2_url(ENDPOINT, base_route=base_route, base_prefix=base_prefix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment