Updated Caper library

This commit is contained in:
Dean Gardiner
2013-10-16 14:58:44 +13:00
parent 8d24d96804
commit e3745b5d74
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ class CaptureConstraint(object):
def _compare_eq(self, fragment, name, expected):
if not hasattr(fragment, name):
return None
return 1.0, False
return 1.0, getattr(fragment, name) == expected
+5 -2
View File
@@ -14,8 +14,9 @@
from logr import Logr
from caper import CaperClosure
from caper.helpers import clean_dict
from caper.result import CaperFragmentNode
from caper.result import CaperFragmentNode, CaperClosureNode
from caper.step import CaptureStep
from caper.constraint import CaptureConstraint
@@ -70,7 +71,9 @@ class CaptureGroup(object):
def parse_subject(self, parent_head, subject):
parent_node = parent_head[0] if type(parent_head) is list else parent_head
# TODO - if subject is a closure?
# TODO just jumping into closures for now, will be fixed later
if type(subject) is CaperClosure:
return [CaperClosureNode(subject, parent_head)]
nodes = []