gradio

Форк
0
/
requirements.test.ts 
29 строк · 1.0 Кб
1
import { describe, it, expect } from "vitest";
2
import { verifyRequirements } from "./requirements";
3

4
describe("verifyRequirements", () => {
5
	const allowedRequirements = [
6
		[
7
			"http://files.pythonhosted.org/packages/62/9c/0467dea0a064a998f94c33d03988f33efc744de1a2a550b56b38910cafa2/streamlit-1.13.0-py2.py3-none-any.whl"
8
		],
9
		[
10
			"https://files.pythonhosted.org/packages/62/9c/0467dea0a064a998f94c33d03988f33efc744de1a2a550b56b38910cafa2/streamlit-1.13.0-py2.py3-none-any.whl"
11
		]
12
	];
13
	allowedRequirements.forEach((requirements) => {
14
		it(`allows http: and https: schemes (requirements=${
15
			requirements[0].split(":")[0]
16
		})`, () => {
17
			expect(() => verifyRequirements(requirements)).not.toThrow();
18
		});
19
	});
20

21
	const notAllowedRequirements = [["emfs:/tmp/foo.whl"], ["file:/tmp/foo.whl"]];
22
	notAllowedRequirements.forEach((requirements) => {
23
		it(`throws an error if the requirements include a not allowed scheme (requirements=${JSON.stringify(
24
			requirements
25
		)})`, () => {
26
			expect(() => verifyRequirements(requirements)).toThrow();
27
		});
28
	});
29
});
30

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.