Update tests to use multipart upload
This commit is contained in:
parent
e8ccfa8233
commit
d94c7fd8cd
2 changed files with 16 additions and 21 deletions
|
@ -99,13 +99,13 @@ class TestBase(unittest.TestCase):
|
|||
""" Upload three test photos """
|
||||
album = cls.client.album.create(cls.TEST_ALBUM, visible=True)
|
||||
photos = [
|
||||
cls.client.photo.upload_encoded("tests/test_photo1.jpg",
|
||||
cls.client.photo.upload("tests/test_photo1.jpg",
|
||||
title=cls.TEST_TITLE,
|
||||
tags=cls.TEST_TAG),
|
||||
cls.client.photo.upload_encoded("tests/test_photo2.jpg",
|
||||
cls.client.photo.upload("tests/test_photo2.jpg",
|
||||
title=cls.TEST_TITLE,
|
||||
tags=cls.TEST_TAG),
|
||||
cls.client.photo.upload_encoded("tests/test_photo3.jpg",
|
||||
cls.client.photo.upload("tests/test_photo3.jpg",
|
||||
title=cls.TEST_TITLE,
|
||||
tags=cls.TEST_TAG),
|
||||
]
|
||||
|
|
|
@ -15,10 +15,10 @@ class TestPhotos(test_base.TestBase):
|
|||
# Check that they're gone
|
||||
self.assertEqual(self.client.photos.list(), [])
|
||||
|
||||
# Re-upload the photos
|
||||
ret_val = self.client.photo.upload_encoded("tests/test_photo1.jpg",
|
||||
# Re-upload the photos, one of them using Bas64 encoding
|
||||
ret_val = self.client.photo.upload("tests/test_photo1.jpg",
|
||||
title=self.TEST_TITLE)
|
||||
self.client.photo.upload_encoded("tests/test_photo2.jpg",
|
||||
self.client.photo.upload("tests/test_photo2.jpg",
|
||||
title=self.TEST_TITLE)
|
||||
self.client.photo.upload_encoded("tests/test_photo3.jpg",
|
||||
title=self.TEST_TITLE)
|
||||
|
@ -56,7 +56,7 @@ class TestPhotos(test_base.TestBase):
|
|||
""" Ensure that duplicate photos are rejected """
|
||||
# Attempt to upload a duplicate
|
||||
with self.assertRaises(openphoto.OpenPhotoDuplicateError):
|
||||
self.client.photo.upload_encoded("tests/test_photo1.jpg",
|
||||
self.client.photo.upload("tests/test_photo1.jpg",
|
||||
title=self.TEST_TITLE)
|
||||
|
||||
# Check there are still three photos
|
||||
|
@ -141,11 +141,6 @@ class TestPhotos(test_base.TestBase):
|
|||
with self.assertRaises(openphoto.NotImplementedError):
|
||||
self.client.photo.replace_encoded(None, None)
|
||||
|
||||
def test_upload(self):
|
||||
""" If photo.upload gets implemented, write a test! """
|
||||
with self.assertRaises(openphoto.NotImplementedError):
|
||||
self.client.photo.upload(None)
|
||||
|
||||
def test_dynamic_url(self):
|
||||
""" If photo.dynamic_url gets implemented, write a test! """
|
||||
with self.assertRaises(openphoto.NotImplementedError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue