Exemplo n.º 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())
Exemplo n.º 2
0
 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())
Exemplo n.º 3
0
 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')
Exemplo n.º 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())
Exemplo n.º 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)