mirror of
https://github.com/actions/setup-python.git
synced 2025-06-28 05:33:47 +00:00
Add range validation for toml files (#726)
This commit is contained in:
parent
f97b83114c
commit
65d7f2d534
4 changed files with 29 additions and 6 deletions
|
@ -107,7 +107,7 @@ describe('Version from file test', () => {
|
|||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'pyproject.toml';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
const pythonVersion = '>=3.7';
|
||||
const pythonVersion = '>=3.7.0';
|
||||
const pythonVersionFileContent = `[project]\nrequires-python = "${pythonVersion}"`;
|
||||
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]);
|
||||
|
@ -119,7 +119,7 @@ describe('Version from file test', () => {
|
|||
await io.mkdirP(tempDir);
|
||||
const pythonVersionFileName = 'pyproject.toml';
|
||||
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
|
||||
const pythonVersion = '>=3.7';
|
||||
const pythonVersion = '>=3.7.0';
|
||||
const pythonVersionFileContent = `[tool.poetry.dependencies]\npython = "${pythonVersion}"`;
|
||||
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
|
||||
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue