コード例 #1
0
ファイル: base.py プロジェクト: jstacoder/py-basecamp
    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()
コード例 #2
0
ファイル: base.py プロジェクト: ngenworks/py-basecamp
    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()
コード例 #3
0
ファイル: base.py プロジェクト: ngenworks/py-basecamp
    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")
コード例 #4
0
ファイル: base.py プロジェクト: ngenworks/py-basecamp
    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")
コード例 #5
0
ファイル: base.py プロジェクト: jstacoder/py-basecamp
    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')
コード例 #6
0
ファイル: base.py プロジェクト: jstacoder/py-basecamp
    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')