コード例 #1
0
    def testBuildSignature(self, mock_client):
        # SETUP
        c = Client('foo', login='******')
        reference = '__method=getDomainNames&__service=DomainService&__hostname=api.transip.nl&__timestamp=123&__nonce=TEST-NONCE'

        # CALL
        message = c._build_signature_message('DomainService', 'getDomainNames', 123, 'TEST-NONCE')

        # VERIFY
        self.assertEqual(message, reference)
コード例 #2
0
    def testBuildSignatureParametersSpecialCharacters(self, mock_client):
        # SETUP
        c = Client('foo', login='******')
        reference = '0=foo%20bar&1=~all&2=%2A.foo&__method=getDomainNames&__service=DomainService&__hostname=api.transip.nl&__timestamp=123&__nonce=TEST-NONCE'

        additional = ['foo bar', '~all', '*.foo']

        # CALL
        message = c._build_signature_message('DomainService', 'getDomainNames', 123, 'TEST-NONCE', additional)

        # VERIFY
        self.assertEqual(message, reference)
コード例 #3
0
ファイル: test_client.py プロジェクト: favoretti/transip-api
    def testBuildSignatureWithAdditinalParameters(self, mock_client):
        # SETUP
        c = Client('foo')
        reference = '0=foo&1=bar&__method=getDomainNames&__service=DomainService&__hostname=api.transip.nl&__timestamp=123&__nonce=TEST-NONCE'

        additional = ['foo', 'bar']

        # CALL
        message = c._build_signature_message('DomainService', 'getDomainNames',
                                             123, 'TEST-NONCE', additional)

        # VERIFY
        self.assertEqual(message, reference)