Unittestler birkaç hata daha yakaladı.
her spec dosyası içerisinde dependency tanımları ve patch olmak zorunda değil. specfile içerisinde bunun için gerekli düzenleme yapıldı. xmlfile içerisine xml hata-yakalama eklendi.
This commit is contained in:
+6
-1
@@ -20,6 +20,8 @@ def getNodeText(node):
|
|||||||
child = node.childNodes[0]
|
child = node.childNodes[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return None
|
return None
|
||||||
|
except AttributeError: # no node by that name
|
||||||
|
return None
|
||||||
if child.nodeType == child.TEXT_NODE:
|
if child.nodeType == child.TEXT_NODE:
|
||||||
return child.data
|
return child.data
|
||||||
else:
|
else:
|
||||||
@@ -126,7 +128,10 @@ class XmlFile(object):
|
|||||||
def getChildElts(self, tagpath):
|
def getChildElts(self, tagpath):
|
||||||
""" returns the children of the given path, only with given type """
|
""" returns the children of the given path, only with given type """
|
||||||
node = self.getNode(tagpath)
|
node = self.getNode(tagpath)
|
||||||
return filter(lambda x:x.nodeType==x.ELEMENT_NODE, node.childNodes)
|
try:
|
||||||
|
return filter(lambda x:x.nodeType==x.ELEMENT_NODE, node.childNodes)
|
||||||
|
except AttributeError:
|
||||||
|
return None
|
||||||
|
|
||||||
def getChildText(self, tagpath):
|
def getChildText(self, tagpath):
|
||||||
node = self.getNode(tagpath)
|
node = self.getNode(tagpath)
|
||||||
|
|||||||
Reference in New Issue
Block a user