1
from twisted.trial.unittest import TestCase
3
from txaws.util import *
5
class MiscellaneousTests(TestCase):
7
def test_hmac_sha1(self):
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='),
17
for key, data, expected in cases:
18
self.assertEqual(hmac_sha1(key, data), expected)
20
def test_iso8601time(self):
21
self.assertEqual("2006-07-07T15:04:56Z", iso8601time((2006,7,7,15,4,56,