mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 02:00:10 +00:00
2fc46bdcfa
* test(manager): replace file snapshots with explicit assertions * test(manager): replace inline snapshots with explicit assertions * test(manager): assert on relevant sections instead of full bodies * test(manager): drop assertions implied by full equality * test(manager): address review feedback * test(manager): assert depType and versioning in the regex matcher
46 lines
1.7 KiB
TypeScript
46 lines
1.7 KiB
TypeScript
import { Fixtures } from '~test/fixtures.ts';
|
|
import type { ExtractConfig } from '../types.ts';
|
|
import { extractPackageFile } from './index.ts';
|
|
|
|
const packageFile = 'setup.py';
|
|
|
|
const config: ExtractConfig = {};
|
|
|
|
describe('modules/manager/pip_setup/extract', () => {
|
|
describe('extractPackageFile()', () => {
|
|
it('returns found deps', () => {
|
|
const content = Fixtures.get(packageFile);
|
|
|
|
expect(
|
|
extractPackageFile(content, packageFile, config)?.deps,
|
|
).toMatchObject([
|
|
{ currentValue: '>=3.1.13.0,<5.0', depName: 'celery' },
|
|
{ currentValue: '>=1.7', depName: 'logging_tree' },
|
|
{ currentValue: '>=2.2', depName: 'pygments' },
|
|
{ currentValue: '>=5.0', depName: 'psutil' },
|
|
{ currentValue: '>=3.0', depName: 'objgraph' },
|
|
{ currentValue: '>=1.11.23,<2.0', depName: 'django' },
|
|
{ currentValue: '>=0.11,<2.0', depName: 'flask' },
|
|
{ currentValue: '>=1.4,<2.0', depName: 'blinker' },
|
|
{ currentValue: '==1.2.3', depName: 'flask2' },
|
|
{ currentValue: '>=19.7.0,<20.0', depName: 'gunicorn' },
|
|
{ currentValue: '>=0.15.3,<0.16', depName: 'Werkzeug' },
|
|
{ currentValue: '>=3.2.1,<4.0', depName: 'statsd' },
|
|
{
|
|
currentValue: '>=2.10.0,<3.0',
|
|
depName: 'requests',
|
|
skipReason: 'ignored',
|
|
},
|
|
{ currentValue: '>=5.27.1,<7.0', depName: 'raven' },
|
|
{ currentValue: '>=0.15.2,<0.17', depName: 'future' },
|
|
{ currentValue: '>=1.0.16,<2.0', depName: 'ipaddress' },
|
|
{ currentValue: '>=5.5.2,<6.0.0', depName: 'zope.interface' },
|
|
]);
|
|
});
|
|
|
|
it('returns nothing', () => {
|
|
expect(extractPackageFile('', packageFile, config)).toBeNull();
|
|
});
|
|
});
|
|
});
|