Example #1
0
    def test_receiving_keyword_dictionary(self):
        en_keyword_dict = {
            'feature': 'Feature',
            'scenario': 'Scenario',
            'given': 'Given',
            'when': 'When',
            'then': 'Then',
            'and': 'And',
        }

        en_text = """
            Feature: a new feature

            Scenario: testing scenario

            Given precondition1
            And precondition2

            When I do some action

            Then I get some result1
            And another result2
            And another result3
        """

        clauses = pyeature.extract(en_text, en_keyword_dict)
        assert len(clauses) is 8
Example #2
0
 def test_extracting_clauses_that_starts_with_given_when_and_then(self):
     ''' [추출] given, when, then으로 시작하는 문장만 clause로 추출한다 '''
     self.text += """Some other words
         And another word
     Tada"""
     extracts = pyeature.extract(self.text)
     assert len(extracts) == 7
Example #3
0
    def test_extracts_every_keywords(self):
        ''' [추출] Feature, Scenario라는 키워드도 인식한다 '''
        self.text = """Feature: some feature

        Scenario: some scenario

        %s """ % self.text
        extracts = pyeature.extract(self.text) 
        assert len(extracts) == 8
Example #4
0
    def test_setting_up_keywords(self):
        ko_keyword_dict = {
            'feature': '기능',
            'scenario': '시나리오',
            'given': '처음에',
            'when': '만약',
            'then': '그러면',
            'and': '그리고',
        }

        clauses = pyeature.extract(ko_text, ko_keyword_dict)
        assert len(clauses) is 8
Example #5
0
 def test_language_option_loads_proper_keyword_dictionary(self):
     # FIXME: should test that keyword_dictionary is being used under the hood
     feature,step,options = pyeature.parse_args(['-l', 'ko'] + self.default_args)
     clauses = pyeature.extract(ko_text, pyeature.lang[options.lang])
     assert len(clauses) is 8
Example #6
0
 def test_extracting_clauses_from_string(self):
     ''' [추출] 텍스트에서 6개의 clause를 추출한다 '''
     extracts = pyeature.extract(self.text)
     assert len(extracts) == 6