Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
    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")
Ejemplo n.º 4
0
    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")
Ejemplo n.º 5
0
    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')
Ejemplo n.º 6
0
    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')