summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/aiointercept/default.nix
blob: 1893fccfe4ff5927a384372c5091de622b17be79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  aiohttp,
  buildPythonPackage,
  ddt,
  fetchFromGitHub,
  hatchling,
  lib,
  multidict,
  pytest-asyncio,
  pytestCheckHook,
  yarl,
}:

buildPythonPackage (finalAttrs: {
  pname = "aiointercept";
  version = "0.1.9";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Polandia94";
    repo = "aiointercept";
    tag = "v${finalAttrs.version}";
    hash = "sha256-ivWdPw7irgrl0mH+mxChRt6ZITey9w/QB9TIxGu5XeU=";
  };

  build-system = [ hatchling ];

  dependencies = [
    aiohttp
    multidict
    yarl
  ];

  pythonImportsCheck = [
    "aiointercept"
    "aiointercept.pytest_plugin"
  ];

  nativeCheckInputs = [
    ddt
    pytest-asyncio
    pytestCheckHook
  ];

  disabledTests = [
    # different indentation
    "test_assert_called_with_json"
    "test_assert_called_with_data_bytes"
    "test_assert_called_with_data_dict"
    "test_assert_called_with_strict_headers_fail"
    # connect to DNS servers
    "test_address_as_instance_of_url_combined_with_pass_through"
    "test_pass_through_unmatched_requests"
    "test_pass_through_with_origin_params"
    "test_passthrough_host_is_allowed"
    "test_passthrough_https_explicit"
    "test_passthrough_unmatched_allows_real_requests"
    "test_passthrough_unmatched_https_no_patterns"
    "test_passthrough_unmatched_https_with_patterns"
    "test_passthrough_unmatched_url_handler_unknown_path_proxied"
    "test_passthrough_unmatched_with_pattern_proxies_unmatched"
    "test_real_request_then_mock_same_host_ignores_stale_dns"
    "test_shared_resolve_no_active_instances_uses_real_resolver"
  ];

  meta = {
    changelog = "https://github.com/Polandia94/aiointercept/blob/${finalAttrs.src.tag}/CHANGELOG.md";
    description = "Aiohttp mock library that routes requests through a real test server";
    homepage = "https://github.com/Polandia94/aiointercept";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.dotlambda ];
  };
})