Esempio n. 1
0
    def test__collapse_params(self):
        """
        Test vectors cut'n'pasted from documented examples:

        Reference: http://docs.amazonwebservices.com/AmazonDevPay/latest/DevPayDeveloperGuide/index.html?LSAPI_Auth_REST.html
        """
        actual = LicenseServiceClient._collapse_params(FAKE_PARAMS.items())

        self.failUnlessEqual(EXPECTED_COLLAPSED_PARAMS, actual)
    def test__collapse_params(self):
        """
        Test vectors cut'n'pasted from documented examples:

        Reference: http://docs.amazonwebservices.com/AmazonDevPay/latest/DevPayDeveloperGuide/index.html?LSAPI_Auth_REST.html
        """
        actual = LicenseServiceClient._collapse_params(FAKE_PARAMS.items())

        self.failUnlessEqual(EXPECTED_COLLAPSED_PARAMS, actual)
Esempio n. 3
0
    def test__collapse_params_does_not_url_encode(self):
        """
        From the reference: "Do not URL encode the parameter values."
        """
        name = 'foo'
        value = 'I have characters urlencoding escaped characters: +*&?\n\0'
        input = [(name, value)]
        expected = name + value
        actual = LicenseServiceClient._collapse_params(input)

        self.failUnlessEqual(expected, actual)
    def test__collapse_params_does_not_url_encode(self):
        """
        From the reference: "Do not URL encode the parameter values."
        """
        name = 'foo'
        value = 'I have characters urlencoding escaped characters: +*&?\n\0'
        input = [ (name, value) ]
        expected = name + value
        actual = LicenseServiceClient._collapse_params(input)

        self.failUnlessEqual(expected, actual)