1import ./make-test-python.nix ({ pkgs, ... }:
2{
3 name = "txredisapi";
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ dandellion ];
6 };
7
8 nodes = {
9 machine =
10 { pkgs, ... }:
11
12 {
13 services.redis.enable = true;
14 services.redis.unixSocket = "/run/redis/redis.sock";
15
16 environment.systemPackages = with pkgs; [ (python38.withPackages (ps: [ ps.twisted ps.txredisapi ps.mock ]))];
17 };
18 };
19
20 testScript = ''
21 start_all()
22 machine.wait_for_unit("redis")
23 machine.wait_for_open_port("6379")
24
25 tests = machine.succeed("PYTHONPATH=\"${pkgs.python3Packages.txredisapi.src}\" python -m twisted.trial ${pkgs.python3Packages.txredisapi.src}/tests")
26 '';
27})