Ejemplo n.º 1
0
    def test_unimplemented_feature(self):
        if not self.runner:
            raise Exception('Test runner not set')

        unimplemented = collections.defaultdict(list)
        for feature_filename in self.iter_feature_filenames('.'):
            feature_filename = os.path.abspath(feature_filename)
            feature = Feature.from_filename(feature_filename)

            for scenario in feature.scenarios:
                if scenario.title not in self.runner.implemented_scenarios[
                        feature_filename]:
                    unimplemented[feature_filename].append(scenario.title)

        if unimplemented:
            raise UnimplementedScenariosError('\n{}'.format('\n'.join(
                ' * {}\n{}'.format(
                    os.path.relpath(feature_filename), '\n'.join(
                        '   * {}'.format(scenario_title)
                        for scenario_title in scenario_titles))
                for feature_filename, scenario_titles in sorted(
                    unimplemented.iteritems()))))
Ejemplo n.º 2
0
 def get_feature(self):
     return Feature.from_filename(self.get_feature_filename())