Browse Source

Updated Caper library

pull/2356/head
Dean Gardiner 12 years ago
parent
commit
e3745b5d74
  1. 2
      libs/caper/constraint.py
  2. 7
      libs/caper/group.py

2
libs/caper/constraint.py

@ -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

7
libs/caper/group.py

@ -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 = []

Loading…
Cancel
Save