示例#1
0
 def test_cannonical_string1(self):
     cs = aws.canonical_string('GET', '/johnsmith/photos/puppy.jpg', {
         'Host': 'johnsmith.s3.amazonaws.com',
         'Date': 'Tue, 27 Mar 2007 19:36:42 +0000',
         })
     self.assertEqual(cs, \
             '''GET\n\n\nTue, 27 Mar 2007 19:36:42 +0000\n/johnsmith/photos/puppy.jpg''')
示例#2
0
 def test_cannonical_string2(self):
     cs = aws.canonical_string('PUT', '/johnsmith/photos/puppy.jpg', {
         'Content-Type': 'image/jpeg',
         'Host': 'johnsmith.s3.amazonaws.com',
         'Date': 'Tue, 27 Mar 2007 21:15:45 +0000',
         'Content-Length': '94328',
         })
     self.assertEqual(cs, \
             '''PUT\n\nimage/jpeg\nTue, 27 Mar 2007 21:15:45 +0000\n/johnsmith/photos/puppy.jpg''')