示例#1
0
def test_no_must_fails():
    txt = """
        #MF is the commented YAML text, having the following convention:
        #MF - field for MF id
        #Comment - field for comments
        #Other fields may be introduced in later versions
        #Regular comments should not break the MF feature
        #Here the MF begins
        #MF NOBUG
        #extrafield: 123
        Feature: feature for test
            As developer I want to have my feature tested

        #Example 1:
            #MF BUG-45
            #Comment: |
            # first line of comment
            # second line
            # last line
            Scenario: some scenario
               Step 1
               Step 2

        #Example 2:
            Scenario: some another scenario
               #MF http://mybugtracker/ID33
               #Comment: bla bla bla
               Some step
               Another step

        """
    feature = Feature.from_string(txt, with_file="dummy.txt")
    mfp = InplaceMustfailParser(feature)
    mustfails = mfp.as_dict()
    assert_false('MustFail' in mustfails, "must not find mustfails")
示例#2
0
 def __load_inplace_mustfails(self):
     mustfail_definitions = {}
     for feature_filename in self.__find_feature_files():
         feature = Feature.from_file(feature_filename)
         inplace_mfp = InplaceMustfailParser(feature)
         if len(inplace_mfp) > 0:
             mustfail_definitions = self.__merge_mfs(mustfail_definitions, inplace_mfp.as_dict())
         return mustfail_definitions
示例#3
0
文件: core.py 项目: jixiaofei/bunch
 def __load_inplace_mustfails(self):
     mustfail_definitions = {}
     for feature_filename in self.__find_feature_files():
         feature = Feature.from_file(feature_filename)
         inplace_mfp = InplaceMustfailParser(feature)
         if len(inplace_mfp) > 0:
             mustfail_definitions = self.__merge_mfs(
                 mustfail_definitions, inplace_mfp.as_dict())
         return mustfail_definitions
示例#4
0
def test_must_fails_feature_scenario_step():
    txt = """
        #MF is the commented YAML text, having the following convention:
        #MF - field for MF id
        #Comment - field for comments
        #Other fields may be introduced in later versions
        #Regular comments should not break the MF feature
        #Here the MF begins
        #MF: NOBUG
        #extrafield: 123
        Feature: feature for test
            As developer I want to have my feature tested

        #Example 1:
            #MF: BUG-45
            #Comment: |
            # first line of comment
            # second line
            # last line
            Scenario: some scenario
               Step 1
               Step 2

        #Example 2:
            Scenario: some another scenario
               #MF: http://mybugtracker/ID33
               #Comment: bla bla bla
               Some step
               Another step

        """
    feature = Feature.from_string(txt, with_file="dummy.txt")
    mfp = InplaceMustfailParser(feature)
    mustfails = mfp.as_dict()
    assert_true('MustFail' in mustfails, "No mustfails found")
    mustfails = mustfails['MustFail']
    assert_equals(len(mustfails), 3, "Not all inplace mustfails found")
    assert_true('scenarios' in mustfails)
    assert_true(len(mustfails['scenarios']) == 1)
    assert_true(len(mustfails['steps']) == 1)
    assert_true(len(mustfails['features']) == 1)