2022-01-09 11:06:32 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2017-04-27 08:24:55 +02:00
|
|
|
, httpbin
|
2022-01-09 11:06:32 +01:00
|
|
|
, pytest
|
|
|
|
, pytestCheckHook
|
2022-05-18 21:15:51 +02:00
|
|
|
, pythonOlder
|
2022-01-09 11:06:32 +01:00
|
|
|
, requests
|
2017-04-27 08:24:55 +02:00
|
|
|
, six
|
2017-04-26 19:02:17 +02:00
|
|
|
}:
|
|
|
|
|
2017-04-27 08:24:55 +02:00
|
|
|
buildPythonPackage rec {
|
2017-05-27 11:25:35 +02:00
|
|
|
pname = "pytest-httpbin";
|
2022-05-18 21:15:51 +02:00
|
|
|
version = "1.0.2";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2017-04-26 19:02:17 +02:00
|
|
|
|
2022-01-14 09:30:10 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kevin1024";
|
|
|
|
repo = "pytest-httpbin";
|
|
|
|
rev = "v${version}";
|
2022-05-18 21:15:51 +02:00
|
|
|
hash = "sha256-S4ThQx4H3UlKhunJo35esPClZiEn7gX/Qwo4kE1QMTI=";
|
2017-04-26 19:02:17 +02:00
|
|
|
};
|
|
|
|
|
2022-01-09 11:06:32 +01:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
2017-04-26 19:02:17 +02:00
|
|
|
|
2022-01-09 11:06:32 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
httpbin
|
|
|
|
six
|
|
|
|
];
|
2017-04-26 19:02:17 +02:00
|
|
|
|
2022-04-03 23:20:31 +02: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://')" ""
|
|
|
|
'';
|
|
|
|
|
2022-01-09 11:06:32 +01:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
requests
|
|
|
|
];
|
2018-02-09 20:37:56 +01:00
|
|
|
|
2022-01-09 11:06:32 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pytest_httpbin"
|
|
|
|
];
|
2018-06-29 19:41:08 +02:00
|
|
|
|
2022-01-09 11:06:32 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Test your HTTP library against a local copy of httpbin.org";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "https://github.com/kevin1024/pytest-httpbin";
|
2022-01-09 11:06:32 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ];
|
2017-04-26 19:02:17 +02:00
|
|
|
};
|
|
|
|
}
|