Exemplo n.º 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
Exemplo n.º 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')
Exemplo n.º 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)
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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ç')
Exemplo n.º 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.')
Exemplo n.º 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')
Exemplo n.º 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.")
Exemplo n.º 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
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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')
Exemplo n.º 14
0
 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')