-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from snyk/fix/setup-py-another-setuptools-import
fix: support another kind of setuptools import
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import path = require('path'); | ||
import { executeSync } from '../../lib/dependencies/sub-process'; | ||
|
||
describe('Test setup_file.py', () => { | ||
it.each` | ||
setupPyContent | ||
${'import setuptools;setuptools.setup(name="test")'} | ||
${'from setuptools import setup;setup(name="test")'} | ||
`("parse works for '$setupPyContent'", ({ setupPyContent }) => { | ||
const result = executeSync( | ||
'python', | ||
['-c', `from setup_file import parse; parse('${setupPyContent}')`], | ||
{ cwd: path.resolve(__dirname, '../../pysrc') } | ||
); | ||
|
||
expect(result.status).toBe(0); | ||
}); | ||
}); |