Python: Copy Python extractor to codeql repo

This commit is contained in:
Taus
2024-02-28 15:15:21 +00:00
parent 297a17975d
commit 6dec323cfc
369 changed files with 165346 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import pytest
import buildtools.install
from tests.buildtools.helper import in_fresh_temp_dir
def test_basic(monkeypatch, mocker):
mocker.patch('subprocess.call')
mocker.patch('subprocess.check_call')
with in_fresh_temp_dir() as path:
monkeypatch.setenv('LGTM_WORKSPACE', path)
monkeypatch.setenv('SEMMLE_DIST', '<none>')
with pytest.raises(SystemExit) as exc_info:
buildtools.install.main(3, '.', [])
assert exc_info.value.code == 0