Updated Caper library
This commit is contained in:
@@ -38,7 +38,7 @@ class CaptureConstraint(object):
|
|||||||
|
|
||||||
def _compare_eq(self, fragment, name, expected):
|
def _compare_eq(self, fragment, name, expected):
|
||||||
if not hasattr(fragment, name):
|
if not hasattr(fragment, name):
|
||||||
return None
|
return 1.0, False
|
||||||
|
|
||||||
return 1.0, getattr(fragment, name) == expected
|
return 1.0, getattr(fragment, name) == expected
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -14,8 +14,9 @@
|
|||||||
|
|
||||||
|
|
||||||
from logr import Logr
|
from logr import Logr
|
||||||
|
from caper import CaperClosure
|
||||||
from caper.helpers import clean_dict
|
from caper.helpers import clean_dict
|
||||||
from caper.result import CaperFragmentNode
|
from caper.result import CaperFragmentNode, CaperClosureNode
|
||||||
from caper.step import CaptureStep
|
from caper.step import CaptureStep
|
||||||
from caper.constraint import CaptureConstraint
|
from caper.constraint import CaptureConstraint
|
||||||
|
|
||||||
@@ -70,7 +71,9 @@ class CaptureGroup(object):
|
|||||||
def parse_subject(self, parent_head, subject):
|
def parse_subject(self, parent_head, subject):
|
||||||
parent_node = parent_head[0] if type(parent_head) is list else parent_head
|
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 = []
|
nodes = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user