about summary refs log blame commit diff
path: root/users/Profpatsch/writers/tests.nix
blob: 13ddfd10e9760feb2e2f35900efba03f844dd307 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                     

   






                              

                        
                                     
      
                     
               
                                          

     

                                             


                   
                                           





                  
{ 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;
}