Skip to content

Commit

Permalink
Merge pull request #1857 from snyk/chore/test-handlers-folder
Browse files Browse the repository at this point in the history
chore: handler test folder separation
  • Loading branch information
lili2311 committed Apr 22, 2021
2 parents 3776b74 + 086fb37 commit 65d88a8
Show file tree
Hide file tree
Showing 47 changed files with 82 additions and 82 deletions.
@@ -0,0 +1,76 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`fix *req*.txt / *.txt Python projects fixes multiple files via -c & -r with the same name (some were already fixed) 1`] = `
"
Successful fixes:
test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-constraints/requirements.txt
✔ Upgraded Django from 1.6.1 to 2.0.1
✔ Upgraded Django from 1.6.1 to 2.0.1 (upgraded in test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-constraints/constraints.txt)
✔ Upgraded Jinja2 from 2.7.2 to 2.7.3 (upgraded in test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-constraints/lib/requirements.txt)
✔ Pinned transitive from 1.0.1 to 2.0.1 (pinned in test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-constraints/constraints.txt)
test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-constraints/lib/requirements.txt
✔ Fixed through test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-constraints/requirements.txt
Summary:
0 items were not fixed
2 items were successfully fixed
6 total issues: 2 High | 2 Medium | 2 Low
6 fixable issues
6 fixed issues"
`;

exports[`fix *req*.txt / *.txt Python projects fixes multiple files via -r with the same name (some were already fixed) 1`] = `
"
Successful fixes:
test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/requirements.txt
✔ Upgraded Django from 1.6.1 to 2.0.1
✔ Upgraded Django from 1.6.1 to 2.0.1 (upgraded in test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/core/requirements.txt)
✔ Upgraded Jinja2 from 2.7.2 to 2.7.3 (upgraded in test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/lib/requirements.txt)
test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/core/requirements.txt
✔ Fixed through test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/requirements.txt
test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/lib/requirements.txt
✔ Fixed through test/acceptance/plugins/python/handlers/pip-requirements/update-dependencies/workspaces/app-with-already-fixed/requirements.txt
Summary:
0 items were not fixed
3 items were successfully fixed
6 total issues: 3 High | 3 Medium
6 fixable issues
6 fixed issues"
`;

exports[`fix *req*.txt / *.txt Python projects retains python markers 1`] = `
"amqp==2.4.2
apscheduler==3.6.0
asn1crypto==0.24.0
astroid==1.6.6
atomicwrites==1.3.0
attrs==19.1.0
automat==0.7.0
backports.functools-lru-cache==1.5 ; python_version < '3.2'
billiard==3.6.0.0
celery==4.3.0
certifi==2019.3.9
cffi==1.12.3
chardet==3.0.4
click==7.1 ; python_version > '1.0'
clickclick==1.2.2
configparser==3.7.4 ; python_version == '2.7'
connexion[swagger-ui]==2.2.0
constantly==15.1.0
cryptography==2.6.1
cssselect==1.0.3
cython==0.29.7
enum34==1.1.6 ; python_version < '2.6'
fastavro==0.21.21
flask-apscheduler==1.11.0
flask==1.0.2
"
`;
@@ -1,8 +1,8 @@

import * as fs from 'fs';
import * as pathLib from 'path';
import { extractProvenance } from '../../../../../../src/plugins/python/handlers/pip-requirements/extract-version-provenance';
import { parseRequirementsFile } from '../../../../../../src/plugins/python/handlers/pip-requirements/update-dependencies/requirements-file-parser';
import { extractProvenance } from '../../../../../../../src/plugins/python/handlers/pip-requirements/extract-version-provenance';
import { parseRequirementsFile } from '../../../../../../../src/plugins/python/handlers/pip-requirements/update-dependencies/requirements-file-parser';

describe('extractProvenance', () => {
const workspacesPath = pathLib.resolve(__dirname, 'workspaces');
Expand Down
@@ -1,12 +1,12 @@
import * as fs from 'fs';
import * as pathLib from 'path';
import * as snykFix from '../../../../../../src';
import { selectFileForPinning } from '../../../../../../src/plugins/python/handlers/pip-requirements';
import { SEVERITY, TestResult } from '../../../../../../src/types';
import * as snykFix from '../../../../../../../src';
import { selectFileForPinning } from '../../../../../../../src/plugins/python/handlers/pip-requirements';
import { SEVERITY, TestResult } from '../../../../../../../src/types';
import {
generateScanResult,
generateTestResult,
} from '../../../../../helpers/generate-entity-to-fix';
} from '../../../../../../helpers/generate-entity-to-fix';

describe('selectFileForPinning', () => {
const workspacesPath = pathLib.resolve(__dirname, 'workspaces');
Expand Down

This file was deleted.

0 comments on commit 65d88a8

Please sign in to comment.