summary refs log tree commit diff
path: root/pkgs/development/python-modules/zope-testbrowser/default.nix
blob: 15b3f74a43945728bb9d9f12e00154860a463af7 (plain) (blame)
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
74
75
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, zope_interface
, zope_schema
, zope-cachedescriptors
, pytz
, webtest
, beautifulsoup4
, soupsieve
, wsgiproxy2
, six
, mock
, zope_testing
, zope_testrunner
, python
}:

buildPythonPackage rec {
  pname = "zope-testbrowser";
  version = "6.0";

  format = "setuptools";

  src = fetchPypi {
    pname = "zope.testbrowser";
    inherit version;
    sha256 = "sha256-RLd6XpA3q+3DZHai6j3H6XTWE85Sk913zAL4iO4x+ho=";
  };

  postPatch = ''
    # remove test that requires network access
    substituteInPlace src/zope/testbrowser/tests/test_doctests.py \
      --replace "suite.addTests(wire)" ""
  '';

  propagatedBuildInputs = [
    setuptools
    zope_interface
    zope_schema
    zope-cachedescriptors
    pytz
    webtest
    beautifulsoup4
    soupsieve
    wsgiproxy2
    six
  ];

  nativeCheckInputs = [
    mock
    zope_testing
    zope_testrunner
  ];

  checkPhase = ''
    ${python.interpreter} -m zope.testrunner --test-path=src
  '';

  pythonImportsCheck = [
    "zope.testbrowser"
    "zope.testbrowser.browser"
    "zope.testbrowser.interfaces"
    "zope.testbrowser.testing"
    "zope.testbrowser.wsgi"
  ];

  meta = {
    description = "Programmable browser for functional black-box tests";
    homepage = "https://github.com/zopefoundation/zope.testbrowser";
    license = lib.licenses.zpl21;
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}