about summary refs log tree commit diff
path: root/users/Profpatsch/writers/tests.nix
blob: 13ddfd10e9760feb2e2f35900efba03f844dd307 (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
{ depot, pkgs, python3, python3Lib }:

let
  transitiveLib = python3Lib {
    name = "transitive";
  } ''
    def transitive(s):
      return s + " 1 2 3"
  '';

  testLib = python3Lib {
    name = "test_lib";
    libraries = _: [ transitiveLib ];
  } ''
    import transitive
    def test():
      return transitive.transitive("test")
  '';

  pythonWithLib = python3 "python-with-lib" {
    libraries = _: [ testLib ];
  } ''
    import test_lib

    assert(test_lib.test() == "test 1 2 3")
  '';

in {
  inherit
    pythonWithLib;
}