Example #1
0
def load_feature(fname, language):
    """ Load and parse a feature file. """

    fname = os.path.abspath(fname)
    feat = parse_file(fname, language)
    return feat
Example #2
0
 def test_should_parse_feature_file_with_use_only_short_form(self):
     feature = parse_file(self.cur_dir + '/resources/valid_no_tags_with_use_only_short_form.feature', self.language)
     self.assertEquals(feature.use_step_defs[0], 'independent_one')
Example #3
0
 def test_should_parse_feature_file_with_background_and_title_and_tags(self):
     feature = parse_file(self.cur_dir + '/resources/Befriend_with_tags_and_background_title.feature', self.language)
     self.assertTrue(feature.has_background())
     self.assertEquals(len(feature.background.steps), 2)
     self.assertEquals(len(feature.scenarios), 2)
     self.assertEquals(len(feature.scenarios[0].tags), 1)
Example #4
0
 def test_should_parse_feature_file_with_full_unix_path_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_with_tags_with_full_unix_path_use_only.feature', self.language)
     self.assertEquals(feature.tags[0], 'one')
     self.assertEquals(feature.use_step_defs[0], '/home/user/independent_one.py')
Example #5
0
 def test_should_parse_feature_file_with_full_windows_path_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_with_tags_with_full_windows_path_use_only.feature', self.language)
     self.assertEquals(feature.tags[0], 'one')
     self.assertEquals(feature.use_step_defs[0], 'C:\\Documents and Settings\\user\\Desktop\\independent_one.py')
Example #6
0
 def test_should_parse_feature_file_with_tags_and_with_multiple_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_with_tags_with_multiple_use_only.feature', self.language)
     self.assertEquals(feature.tags[0], 'one')
     self.assertEquals(feature.use_step_defs[0], 'independent_one')
     self.assertEquals(feature.use_step_defs[1], 'te st')
Example #7
0
 def test_should_parse_feature_file_with_unicode_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_with_tags_with_unicode_use_only.feature', self.language)
     self.assertEquals(feature.tags[0], 'one')
     self.assertEquals(feature.use_step_defs[0], 'unicodeèédç')
Example #8
0
 def test_should_parse_feature_file_without_tags_and_without_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_no_tags_no_use_only.feature', self.language)
     self.assertEquals(feature.name, 'Independence of the counter.')
Example #9
0
 def test_should_parse_feature_file_with_tags_and_without_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_with_tags_no_use_only.feature', self.language)
     self.assertEquals(feature.tags[0], 'one')
Example #10
0
 def test_should_parse_feature_file_without_tags_and_without_use_only(self):
     feature = parse_file(self.cur_dir + '/resources/valid_no_tags_no_use_only_fr.feature', self.language)
     self.assertEquals(feature.name, "L'indépendance des compteurs.")
Example #11
0
def load_feature(fname, language):
    """ Load and parse a feature file. """

    fname = os.path.abspath(fname)
    feat = parse_file(fname, language)
    return feat
 def test_should_parse_feature_file_with_background_and_no_tags(self):
     feature = parse_file('resources/Befriend_without_tags.feature', self.language)
     self.assertTrue(feature.has_background())
     self.assertEquals(len(feature.background.steps), 2)
     self.assertEquals(len(feature.scenarios), 2)
 def test_should_parse_feature_file_without_tags_and_with_use_only(self):
     feature = parse_file('resources/valid_no_tags_with_use_only.feature', self.language)
     self.assertEquals(feature.use_step_defs[0], 'independent_one')
 def test_should_parse_feature_file_with_tags_and_without_use_only(self):
     feature = parse_file('resources/valid_with_tags_no_use_only_fr.feature', self.language)
     self.assertEquals(feature.tags[0], 'un')