1 | import PythonSystemPackageLookup from '../src/PythonSystemPackageLookup'
|
2 | import { fixture } from './test-functions'
|
3 |
|
4 | const packageLookup = PythonSystemPackageLookup.fromFile(fixture('py-system-package-lookup.json'))
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | test('python-sys-lookup:full-depth', () => {
|
10 | const requirements = packageLookup.lookupSystemPackage(
|
11 | 'numpy',
|
12 | 3,
|
13 | 'deb',
|
14 | 'xenial')
|
15 | expect(requirements).toEqual(['xenial-numpy-dependencies'])
|
16 | })
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | test('python-sys-lookup:no-sysname', () => {
|
22 | const requirements = packageLookup.lookupSystemPackage(
|
23 | 'numpy',
|
24 | 3,
|
25 | 'deb',
|
26 | 'test')
|
27 | expect(requirements).toEqual(['deb-default-dependencies'])
|
28 | })
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | test('python-sys-lookup:no-package-type', () => {
|
34 | const requirements = packageLookup.lookupSystemPackage(
|
35 | 'numpy',
|
36 | 3,
|
37 | 'rpm',
|
38 | 'test')
|
39 | expect(requirements).toEqual(['default-default-dependencies'])
|
40 | })
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | test('python-sys-lookup:no-python-version', () => {
|
46 | const requirements = packageLookup.lookupSystemPackage(
|
47 | 'numpy',
|
48 | 2,
|
49 | 'deb',
|
50 | 'xenial')
|
51 | expect(requirements).toEqual(['python-2-dependency'])
|
52 | })
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | test('python-sys-lookup:no-package', () => {
|
58 | const requirements = packageLookup.lookupSystemPackage(
|
59 | 'my-fake-package',
|
60 | 2,
|
61 | 'rpm',
|
62 | 'test')
|
63 | expect(requirements).toEqual([])
|
64 | })
|