1{
2 lib,
3 buildPythonPackage,
4 click,
5 faker,
6 fetchFromGitHub,
7 flask,
8 gunicorn,
9 pyopenssl,
10 pytestCheckHook,
11 pythonAtLeast,
12 pythonOlder,
13 requests,
14 setuptools-scm,
15 standard-telnetlib,
16}:
17
18buildPythonPackage rec {
19 pname = "threat9-test-bed";
20 version = "0.6.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "threat9";
27 repo = "threat9-test-bed";
28 rev = "v${version}";
29 hash = "sha256-0YSjMf2gDdrvkDaT77iwfCkiDDXKHnZyI8d7JmBSuCg=";
30 };
31
32 build-system = [ setuptools-scm ];
33
34 dependencies = [
35 click
36 faker
37 flask
38 gunicorn
39 pyopenssl
40 requests
41 ]
42 ++ lib.optionals (pythonAtLeast "3.13") [ standard-telnetlib ];
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 pythonImportsCheck = [ "threat9_test_bed" ];
47
48 disabledTests = [
49 # Assertion issue with the response codes
50 "test_http_service_mock"
51 "tests_http_service_mock"
52 "test_http_service_mock_random_port"
53 ];
54
55 meta = with lib; {
56 description = "Module for adding unittests.mock as view functions";
57 homepage = "https://github.com/threat9/threat9-test-bed";
58 license = licenses.bsd3;
59 maintainers = with maintainers; [ fab ];
60 mainProgram = "test-bed";
61 };
62}