2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, httpbin
|
2022-02-10 20:34:41 +00:00
|
|
|
, pytest
|
|
|
|
, pytestCheckHook
|
2022-06-26 10:26:21 +00:00
|
|
|
, pythonOlder
|
2022-02-10 20:34:41 +00:00
|
|
|
, requests
|
2020-04-24 23:36:52 +00:00
|
|
|
, six
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-httpbin";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "1.0.2";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kevin1024";
|
|
|
|
repo = "pytest-httpbin";
|
|
|
|
rev = "v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
hash = "sha256-S4ThQx4H3UlKhunJo35esPClZiEn7gX/Qwo4kE1QMTI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
httpbin
|
|
|
|
six
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Remove assertion that doesn't hold for Flask 2.1.0
|
|
|
|
substituteInPlace tests/test_server.py \
|
|
|
|
--replace "assert response.headers['Location'].startswith('https://')" ""
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
requests
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pytest_httpbin"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Test your HTTP library against a local copy of httpbin.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/kevin1024/pytest-httpbin";
|
2022-02-10 20:34:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|