Atom Pub binding now returns an empty unicode string for the repo name if the server does not return a repo name which is consistent with the browser binding. Also change the toString method of repo to use repo ID instead of repo name because not all repos return a name.

git-svn-id: https://svn.apache.org/repos/asf/chemistry/cmislib/trunk@1759039 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/cmislib/atompub/binding.py b/src/cmislib/atompub/binding.py
index a5cc469..f1a629f 100644
--- a/src/cmislib/atompub/binding.py
+++ b/src/cmislib/atompub/binding.py
@@ -948,7 +948,7 @@
 
     def __str__(self):
         """To string"""
-        return self.getRepositoryName()
+        return self.getRepositoryId()
 
     def reload(self):
         """
@@ -1155,7 +1155,11 @@
         if self._repositoryName is None:
             if self.xmlDoc is None:
                 self.reload()
-            self._repositoryName = self.xmlDoc.getElementsByTagNameNS(CMIS_NS, 'repositoryName')[0].firstChild.data
+            if self.xmlDoc.getElementsByTagNameNS(CMIS_NS, 'repositoryName')[0].firstChild:
+                self._repositoryName = self.xmlDoc.getElementsByTagNameNS(CMIS_NS, 'repositoryName')[0].firstChild.data
+            else:
+                self._repositoryName = u''
+
         return self._repositoryName
 
     def getRepositoryInfo(self):