This commit is contained in:
@@ -44,14 +44,23 @@ test('Python API tools are syntax-valid and contain reusable 401 authentication
|
||||
await fs.rm(path.join(toolsDir, '__pycache__'), { recursive: true, force: true });
|
||||
|
||||
const common = await read('tools/python/common.py');
|
||||
const sonar = await read('sonar-project.properties');
|
||||
const requirements = await read('requirements-dev.txt');
|
||||
const pkg = JSON.parse(await read('package.json'));
|
||||
assert.match(common, /class ApiClient/);
|
||||
assert.match(common, /error\.code == 401/);
|
||||
assert.match(common, /error\.code != 401/);
|
||||
assert.match(common, /MAX_AUTH_ATTEMPTS/);
|
||||
assert.match(common, /self\.prompt_credentials\(\)/);
|
||||
assert.match(common, /getpass\.getpass/);
|
||||
assert.match(common, /os\.getenv\(API_USER_ENV/);
|
||||
assert.match(common, /os\.getenv\(API_PASSWORD_ENV/);
|
||||
assert.match(common, /def encode_multipart/);
|
||||
assert.match(common, /traceback\.print_exception/);
|
||||
assert.doesNotMatch(common, /Content-Type:.*application\/octet-stream/);
|
||||
assert.match(pkg.scripts['test:coverage'], /test:coverage:python/);
|
||||
assert.match(pkg.scripts['test:coverage:python'], /coverage\/python\/coverage\.xml/);
|
||||
assert.match(sonar, /sonar\.python\.coverage\.reportPaths=coverage\/python\/coverage\.xml/);
|
||||
assert.match(requirements, /^coverage==/m);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user