diff --git a/pkgs/development/python-modules/threat9-test-bed/default.nix b/pkgs/development/python-modules/threat9-test-bed/default.nix new file mode 100644 index 000000000000..35d5f1389fd1 --- /dev/null +++ b/pkgs/development/python-modules/threat9-test-bed/default.nix @@ -0,0 +1,65 @@ +{ lib +, buildPythonPackage +, click +, faker +, fetchFromGitHub +, flask +, gunicorn +, pyopenssl +, pytestCheckHook +, pythonOlder +, setuptools-scm +, requests +}: + +buildPythonPackage rec { + pname = "threat9-test-bed"; + version = "0.6.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "threat9"; + repo = pname; + rev = "v${version}"; + hash = "sha256-0YSjMf2gDdrvkDaT77iwfCkiDDXKHnZyI8d7JmBSuCg="; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + click + faker + flask + gunicorn + pyopenssl + requests + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "threat9_test_bed" + ]; + + disabledTests = [ + # Assertion issue with the response codes + "test_http_service_mock" + "tests_http_service_mock" + "test_http_service_mock_random_port" + ]; + + meta = with lib; { + description = "Module for adding unittests.mock as view functions"; + homepage = "https://github.com/threat9/threat9-test-bed"; + license = licenses.bsd3; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 872a35c0d357..a696f04de6e3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10462,6 +10462,8 @@ in { threadpoolctl = callPackage ../development/python-modules/threadpoolctl { }; + threat9-test-bed = callPackage ../development/python-modules/threat9-test-bed { }; + three-merge = callPackage ../development/python-modules/three-merge { }; thrift = callPackage ../development/python-modules/thrift { };