def test_no_endpoint(self): """ Test what happens if the endpoint class attr isn't set. """ account_url = 'http://example.com' access_token = 'abceasyas123' some_api = Basecamp(account_url, access_token) some_api.construct_url()
def test_no_endpoint(self): """ Test what happens if the endpoint class attr isn't set. """ account_url = "http://example.com" access_token = "abceasyas123" some_api = Basecamp(account_url, access_token) some_api.construct_url()
def test_endpoint_slashes(self): """ Test that slashes are removed from the endpoint. """ account_url = "http://example.com" access_token = "abceasyas123" some_api = Basecamp(account_url, access_token) some_api.endpoint = "/foobars/" self.assertEquals(some_api.construct_url(), "http://example.com/foobars?access_token=abceasyas123")
def test_good_url(self): """ Test construction of a URL. """ account_url = "http://example.com" access_token = "abceasyas123" some_api = Basecamp(account_url, access_token) some_api.endpoint = "foobars" self.assertEquals(some_api.construct_url(), "http://example.com/foobars?access_token=abceasyas123")
def test_endpoint_slashes(self): """ Test that slashes are removed from the endpoint. """ account_url = 'http://example.com' access_token = 'abceasyas123' some_api = Basecamp(account_url, access_token) some_api.endpoint = '/foobars/' self.assertEquals( some_api.construct_url(), 'http://example.com/foobars?access_token=abceasyas123')
def test_good_url(self): """ Test construction of a URL. """ account_url = 'http://example.com' access_token = 'abceasyas123' some_api = Basecamp(account_url, access_token) some_api.endpoint = 'foobars' self.assertEquals( some_api.construct_url(), 'http://example.com/foobars?access_token=abceasyas123')