Added check for None on changeToken. Fixed a bad reference to unqualified TEST_ROOT_PATH in cmislibtest
git-svn-id: https://svn.apache.org/repos/asf/chemistry/cmislib/trunk@1208051 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/cmislib/model.py b/src/cmislib/model.py
index 4ca220d..b2a4a0d 100644
--- a/src/cmislib/model.py
+++ b/src/cmislib/model.py
@@ -1917,7 +1917,8 @@
# if we have a change token, we must pass it back, per the spec
args = {}
- if self.properties.has_key('cmis:changeToken'):
+ if (self.properties.has_key('cmis:changeToken') and
+ self.properties['cmis:changeToken'] != None):
args = {"changeToken": self.properties['cmis:changeToken']}
# build the entry based on the properties provided
@@ -2518,7 +2519,8 @@
# if we have a change token, we must pass it back, per the spec
args = {}
- if self.properties.has_key('cmis:changeToken'):
+ if (self.properties.has_key('cmis:changeToken') and
+ self.properties['cmis:changeToken'] != None):
args = {"changeToken": self.properties['cmis:changeToken']}
# put the content file
@@ -2557,7 +2559,8 @@
# if we have a change token, we must pass it back, per the spec
args = {}
- if self.properties.has_key('cmis:changeToken'):
+ if (self.properties.has_key('cmis:changeToken') and
+ self.properties['cmis:changeToken'] != None):
args = {"changeToken": self.properties['cmis:changeToken']}
# delete the content stream
diff --git a/src/tests/cmislibtest.py b/src/tests/cmislibtest.py
index 5c70612..18cdd67 100644
--- a/src/tests/cmislibtest.py
+++ b/src/tests/cmislibtest.py
@@ -39,7 +39,7 @@
try:
os.stat(settings.TEST_BINARY_1)
except:
- settings.TEST_BINARY_1 = os.path.join(my_dir, settings.TEST_BINARY_1)
+ settings.TEST_BINARY_1 = os.path.join(my_dir, TEST_BINARY_1)
try:
os.stat(settings.TEST_BINARY_2)
except:
@@ -54,7 +54,7 @@
""" Create a root test folder for the test. """
self._cmisClient = CmisClient(settings.REPOSITORY_URL, settings.USERNAME, settings.PASSWORD, **settings.EXT_ARGS)
self._repo = self._cmisClient.getDefaultRepository()
- self._rootFolder = self._repo.getObjectByPath(TEST_ROOT_PATH)
+ self._rootFolder = self._repo.getObjectByPath(settings.TEST_ROOT_PATH)
self._folderName = " ".join(['cmislib', self.__class__.__name__, str(time())])
self._testFolder = self._rootFolder.createFolder(self._folderName)
diff --git a/src/tests/settings.py b/src/tests/settings.py
index dcf32be..a74f247 100644
--- a/src/tests/settings.py
+++ b/src/tests/settings.py
@@ -22,10 +22,10 @@
#
# CMIS repository's service URL
#REPOSITORY_URL = 'http://cmis.alfresco.com/s/cmis'
-REPOSITORY_URL = 'http://localhost:8081/chemistry/atom' # Apache Chemistry
+#REPOSITORY_URL = 'http://localhost:8081/chemistry/atom' # Apache Chemistry
#REPOSITORY_URL = 'http://cmis.dnsdojo.com:8080/p8cmis/resources/DaphneA/Service'
#REPOSITORY_URL = 'http://cmis.dnsdojo.com:8080/p8cmis/'
-#REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom' # Alfresco >= 4.0
+REPOSITORY_URL = 'http://localhost:8080/alfresco/cmisatom' # Alfresco 4.0
#REPOSITORY_URL = 'http://localhost:8080/alfresco/s/api/cmis' # Alfresco
#REPOSITORY_URL = 'http://cmis.demo.nuxeo.org/nuxeo/atom/cmis' # Nuxeo demo
#REPOSITORY_URL = 'http://localhost:8080/nuxeo/atom/cmis' # Nuxeo local