示例#1
0
 def test_successful_upload_from_url_sync_dont_store(self):
     file = File.upload_from_url_sync(self.image_url,
                                      store=False,
                                      interval=1)
     self.assertIsInstance(file, File)
     self.assertEqual(file.filename(), 'Octocat.png')
     self.assertIsNone(file.datetime_stored())
 def test_successful_upload_from_url_sync_store(self):
     file = File.upload_from_url_sync(
         'https://github.com/images/error/angry_unicorn.png',
         store=True,
         interval=1
     )
     self.assertIsInstance(file, File)
     self.assertIsNotNone(file.datetime_stored())
 def test_successful_upload_from_url_sync_with_filename(self):
     file = File.upload_from_url_sync(
         'https://github.com/images/error/angry_unicorn.png',
         filename='meh.png',
         interval=1
     )
     self.assertIsInstance(file, File)
     self.assertEqual(file.filename(), 'meh.png')
示例#4
0
 def test_successful_upload_from_url_sync_store(self):
     file = File.upload_from_url_sync(self.image_url,
                                      store=True,
                                      interval=1)
     self.assertIsInstance(file, File)
     self.assertIsNotNone(file.datetime_stored())
示例#5
0
 def test_upload_invalid_signature(self):
     conf.secret = 'abc'
     with self.assertRaises(AuthenticationError):
         File.upload_from_url_sync(self.image_url, store=False, interval=1)