2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
2023-03-04 12:14:45 +00:00
|
|
|
, aiohttp
|
|
|
|
, asgiref
|
2021-03-09 03:18:52 +00:00
|
|
|
, buildPythonPackage
|
2020-08-20 17:08:02 +00:00
|
|
|
, decorator
|
2022-09-30 11:47:45 +00:00
|
|
|
, fastapi
|
2023-03-04 12:14:45 +00:00
|
|
|
, fetchPypi
|
2021-02-05 17:12:51 +00:00
|
|
|
, gevent
|
2023-03-04 12:14:45 +00:00
|
|
|
, httptools
|
2022-09-30 11:47:45 +00:00
|
|
|
, httpx
|
2023-03-04 12:14:45 +00:00
|
|
|
, isPy3k
|
|
|
|
, pook
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-magic
|
|
|
|
, pythonOlder
|
2021-02-05 17:12:51 +00:00
|
|
|
, redis
|
|
|
|
, requests
|
|
|
|
, sure
|
2023-03-04 12:14:45 +00:00
|
|
|
, urllib3
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mocket";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "3.11.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-OIdLP3hHnPZ9MqrHt6G5t2SSO342+jTACgzxM6RjVYM=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
decorator
|
2023-03-04 12:14:45 +00:00
|
|
|
httptools
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic
|
2020-08-20 17:08:02 +00:00
|
|
|
urllib3
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
pook = [
|
|
|
|
pook
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
aiohttp
|
2023-03-04 12:14:45 +00:00
|
|
|
asgiref
|
2022-09-30 11:47:45 +00:00
|
|
|
fastapi
|
2021-02-05 17:12:51 +00:00
|
|
|
gevent
|
2022-09-30 11:47:45 +00:00
|
|
|
httpx
|
2023-03-04 12:14:45 +00:00
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
redis
|
|
|
|
requests
|
|
|
|
sure
|
2023-03-04 12:14:45 +00:00
|
|
|
] ++ passthru.optional-dependencies.pook;
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
# Skip http tests
|
2022-02-10 20:34:41 +00:00
|
|
|
SKIP_TRUE_HTTP = true;
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
2021-03-09 03:18:52 +00:00
|
|
|
# Requires a live Redis instance
|
2023-03-04 12:14:45 +00:00
|
|
|
"tests/main/test_redis.py"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# tests that require network access (like DNS lookups)
|
|
|
|
"test_truesendall"
|
|
|
|
"test_truesendall_with_chunk_recording"
|
|
|
|
"test_truesendall_with_gzip_recording"
|
|
|
|
"test_truesendall_with_recording"
|
|
|
|
"test_wrongpath_truesendall"
|
|
|
|
"test_truesendall_with_dump_from_recording"
|
|
|
|
"test_truesendall_with_recording_https"
|
|
|
|
"test_truesendall_after_mocket_session"
|
|
|
|
"test_real_request_session"
|
2021-03-09 03:18:52 +00:00
|
|
|
"test_asyncio_record_replay"
|
2022-10-30 15:09:59 +00:00
|
|
|
"test_gethostbyname"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"mocket"
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-03-04 12:14:45 +00:00
|
|
|
description = "A socket mock framework for all kinds of sockets including web-clients";
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://github.com/mindflayer/python-mocket";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/mindflayer/python-mocket/releases/tag/${version}";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|