Esempio n. 1
0
 def _get_status_icon_and_tooltip(self, plugin, config):
     precompiler = pre_compiler.PreCompiler(config, print_output=False)
     icon, tooltip = self._get_success_status_meta(
         plugin.get_pre_compiler_icon())
     try:
         pre_compiler.check_pre_compiler(precompiler)
     except utils.ProgramCheckFailedError as e:
         icon, tooltip = self._get_error_status_meta(e)
     return icon, tooltip
Esempio n. 2
0
    def test_get_version(self):
        version = pre_compiler.get_version(self.precompiler, include_all=True)
        assert len(version.splitlines()) == 2
        version = pre_compiler.get_version(self.precompiler, include_all=False)
        print(version)
        assert len(version.splitlines()) == 1
        assert version == '1.0.0'

        assert self.broken_precompiler.get_version() == 'PreCompiler not found'

        test_precompiler = pre_compiler.PreCompiler(EchoPrecompilerConfig())
        test_precompiler.config.path = sys.executable
        test_precompiler.config.version_command_args = ['--version']
        test_precompiler.config.version_regex = ''
        assert test_precompiler.get_version()
Esempio n. 3
0
 def setup_class(cls):
     cls.precompiler = pre_compiler.PreCompiler(
         EchoPrecompilerConfig(), working_dir=tempfile.gettempdir())
     cls.broken_precompiler = pre_compiler.PreCompiler(
         pre_compiler.PreCompilerConfig())
Esempio n. 4
0
 def _get_program_runner(self, config, *args):
     return pre_compiler.PreCompiler(config)
Esempio n. 5
0
 def _get_version(self, _, config):
     precompiler = pre_compiler.PreCompiler(config, print_output=False)
     return pre_compiler.get_version(precompiler, include_all=False)