示例#1
0
 def __init__(self, parent):
     for i in dir(parent):
         if not i.startswith("__"):
             setattr(self, i, getattr(parent, i))
     if self.subject == BROWSER:
         self.entry.__globals__.update(get_splinter_actions(parent))
         self.exit.__globals__.update(get_splinter_actions(parent))
示例#2
0
def _get_extra_context(instance, extra_context={}):
    subject_name = getattr(instance, "subject", None)

    if subject_name:
        extra_context = {"it": _subject(instance)(subject_name), "its": _subject(instance, parent_name=subject_name)}

        if subject_name == BROWSER:
            extra_context.update(get_splinter_actions(instance))

    return extra_context
示例#3
0
 def __init__(self, *args, **kwargs):
     if getattr(self, "subject", None) == BROWSER:
         setattr(self, BROWSER, splinter.Browser("zope.testbrowser"))
         self.setUp.__globals__.update(get_splinter_actions(self))
     super(RedRoverLiveTest, self).__init__(*args, **kwargs)