Python3 support
This commit is contained in:
parent
6c75abc9a8
commit
0805f032fb
14 changed files with 131 additions and 96 deletions
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
try:
|
||||
|
@ -35,9 +36,9 @@ class TestBase(unittest.TestCase):
|
|||
""" Ensure there is nothing on the server before running any tests """
|
||||
if cls.debug:
|
||||
if cls.api_version is None:
|
||||
print "\nTesting Latest %s" % cls.testcase_name
|
||||
print("\nTesting Latest %s" % cls.testcase_name)
|
||||
else:
|
||||
print "\nTesting %s v%d" % (cls.testcase_name, cls.api_version)
|
||||
print("\nTesting %s v%d" % (cls.testcase_name, cls.api_version))
|
||||
|
||||
cls.client = openphoto.OpenPhoto(config_file=cls.config_file,
|
||||
api_version=cls.api_version)
|
||||
|
@ -71,9 +72,9 @@ class TestBase(unittest.TestCase):
|
|||
self.photos = self.client.photos.list()
|
||||
if len(self.photos) != 3:
|
||||
if self.debug:
|
||||
print "[Regenerating Photos]"
|
||||
print("[Regenerating Photos]")
|
||||
else:
|
||||
print " ",
|
||||
print(" ", end='')
|
||||
sys.stdout.flush()
|
||||
if len(self.photos) > 0:
|
||||
self._delete_all()
|
||||
|
@ -85,16 +86,16 @@ class TestBase(unittest.TestCase):
|
|||
self.tags[0].id != self.TEST_TAG or
|
||||
str(self.tags[0].count) != "3"):
|
||||
if self.debug:
|
||||
print "[Regenerating Tags]"
|
||||
print("[Regenerating Tags]")
|
||||
else:
|
||||
print " ",
|
||||
print(" ", end='')
|
||||
sys.stdout.flush()
|
||||
self._delete_all()
|
||||
self._create_test_photos()
|
||||
self.photos = self.client.photos.list()
|
||||
self.tags = self.client.tags.list()
|
||||
if len(self.tags) != 1:
|
||||
print "Tags: %s" % self.tags
|
||||
print("Tags: %s" % self.tags)
|
||||
raise Exception("Tag creation failed")
|
||||
|
||||
self.albums = self.client.albums.list()
|
||||
|
@ -102,9 +103,9 @@ class TestBase(unittest.TestCase):
|
|||
self.albums[0].name != self.TEST_ALBUM or
|
||||
self.albums[0].count != "3"):
|
||||
if self.debug:
|
||||
print "[Regenerating Albums]"
|
||||
print("[Regenerating Albums]")
|
||||
else:
|
||||
print " ",
|
||||
print(" ", end='')
|
||||
sys.stdout.flush()
|
||||
self._delete_all()
|
||||
self._create_test_photos()
|
||||
|
@ -112,7 +113,7 @@ class TestBase(unittest.TestCase):
|
|||
self.tags = self.client.tags.list()
|
||||
self.albums = self.client.albums.list()
|
||||
if len(self.albums) != 1:
|
||||
print "Albums: %s" % self.albums
|
||||
print("Albums: %s" % self.albums)
|
||||
raise Exception("Album creation failed")
|
||||
|
||||
logging.info("\nRunning %s..." % self.id())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue