Example #1
0
    def test_it_creates_the_included_modelers(self, _, __):
        # Arrange
        orchestrator = Orchestrator(fake('base_path'), fake('Model'))

        # Act
        orchestrator.include(self.generic_modeler_class)
        orchestrator.process('file_name')

        # Assert
        self.generic_modeler_class.assert_called_once_with(ANY, ANY, ANY)
Example #2
0
    def test_process_raises_exception_if_all_files_had_been_processed(self,
                                              source_code_parser_class_mock,
                                              _):
        # Arrange
        source_code_parser_mock = fake('SourceCodeParser')
        source_code_parser_mock.add_files.side_effect = [True, False]
        source_code_parser_class_mock.return_value = source_code_parser_mock
        orchestrator = Orchestrator(fake('base_path'), fake('Model'))

        # Act
        orchestrator.include(self.generic_modeler_class)
        orchestrator.process('file_name')

        # Assert
        assert_raises(AlreadyProcessed, orchestrator.process, 'file_name')
Example #3
0
    def run(self):
        orchestrator = Orchestrator(self.file_set.directory, self.model)
        orchestrator.include(Module)
        orchestrator.include(Class_)
        orchestrator.include(Function)

        file_list = [f for f in self.file_set]

        orchestrator.process(file_list)

        return self.model