Example #1
0
    def test_prepend_path(self):

        # Add a path to prepend to source paths in reports
        yaml_data = copy.deepcopy(self.YAML_DATA)
        yaml_data['prepend_path'] = 'base/path'

        # Create an in-memory YAML file from the data
        yaml_file = self._yaml_buffer(yaml_data)

        # Create the suite description using the YAML file
        desc = SuiteDescription(yaml_file, self.temp_dir)

        # Check that the prepend path is stored
        self.assertEqual(desc.prepend_path(), 'base/path')
Example #2
0
    def test_valid_description(self):

        # Create an in-memory YAML file from the data
        yaml_file = self._yaml_buffer(self.YAML_DATA)

        # Create the suite description using the YAML file
        desc = SuiteDescription(yaml_file, self.temp_dir)

        # Check that the root directory is stored
        self.assertEqual(desc.root_dir(), self.temp_dir)

        # Check that we find the files we expect
        self.assertEqual(desc.suite_name(), self.YAML_DATA['test_suite_name'])
        self.assertEqual(desc.lib_paths(), self.LIB_FILES)
        self.assertEqual(desc.src_paths(), self.SRC_FILES)
        self.assertEqual(desc.spec_paths(), self.SPEC_FILES)
        self.assertEqual(desc.fixture_paths(), self.FIXTURE_FILES)
        self.assertEqual(desc.test_runner(), self.YAML_DATA['test_runner'])
        self.assertEqual(desc.prepend_path(), '')