Exemplo n.º 1
0
    def test_steps_with_same_prefix_are_not_ordering_sensitive(self):
        # -- RELATED-TO: issue #280
        # pylint: disable=unused-argument
        def step_func1(context): pass   # pylint: disable=multiple-statements
        def step_func2(context): pass   # pylint: disable=multiple-statements
        # pylint: enable=unused-argument
        matcher1 = SimplifiedRegexMatcher(step_func1, "I do something")
        matcher2 = SimplifiedRegexMatcher(step_func2, "I do something more")

        # -- CHECK: ORDERING SENSITIVITY
        matched1 = matcher1.match(matcher2.string)
        matched2 = matcher2.match(matcher1.string)
        assert matched1 is None
        assert matched2 is None

        # -- CHECK: Can match itself (if step text is simple)
        matched1 = matcher1.match(matcher1.string)
        matched2 = matcher2.match(matcher2.string)
        assert isinstance(matched1, Match)
        assert isinstance(matched2, Match)
Exemplo n.º 2
0
 def test_step_should_not_use_regex_begin_and_end_marker(self):
     SimplifiedRegexMatcher(None, "^I do something$")
Exemplo n.º 3
0
 def test_step_should_not_use_regex_begin_and_end_marker(self):
     with pytest.raises(AssertionError):
         SimplifiedRegexMatcher(None, "^I do something$")