~oubiwann/txaws/484783-move-ec2-to-cloud

« back to all changes in this revision

Viewing changes to txaws/tests/test_util.py

  • Committer: Robert Collins
  • Date: 2009-04-26 08:32:36 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: robertc@robertcollins.net-20090426083236-hmgjgjd7kni0vxjm
Various refactorings and [minor] cleanups, start of a GUI client, a new credentials and utils module.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from twisted.trial.unittest import TestCase
 
2
 
 
3
from txaws.util import *
 
4
 
 
5
class MiscellaneousTests(TestCase):
 
6
 
 
7
    def test_hmac_sha1(self):
 
8
        cases = [
 
9
            ('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b'.decode('hex'),
 
10
             'Hi There', 'thcxhlUFcmTii8C2+zeMjvFGvgA='),
 
11
            ('Jefe', 'what do ya want for nothing?',
 
12
             '7/zfauXrL6LSdBbV8YTfnCWafHk='),
 
13
            ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'.decode('hex'),
 
14
             '\xdd' * 50, 'El1zQrmsEc2Ro5r0iqF7T2PxddM='),
 
15
            ]
 
16
 
 
17
        for key, data, expected in cases:
 
18
            self.assertEqual(hmac_sha1(key, data), expected)