2021-06-24 21:34:03 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }:
|
|
|
|
{
|
|
|
|
name = "txredisapi";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ dandellion ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes = {
|
|
|
|
machine =
|
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2021-10-23 03:44:07 +00:00
|
|
|
services.redis.servers."".enable = true;
|
2021-06-24 21:34:03 +00:00
|
|
|
|
2023-02-26 05:32:05 +00:00
|
|
|
environment.systemPackages = with pkgs; [ (python3.withPackages (ps: [ ps.twisted ps.txredisapi ps.mock ]))];
|
2021-06-24 21:34:03 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-10-23 03:44:07 +00:00
|
|
|
testScript = { nodes, ... }: let
|
|
|
|
inherit (nodes.machine.config.services) redis;
|
|
|
|
in ''
|
2021-06-24 21:34:03 +00:00
|
|
|
start_all()
|
|
|
|
machine.wait_for_unit("redis")
|
2021-10-23 03:44:07 +00:00
|
|
|
machine.wait_for_file("${redis.servers."".unixSocket}")
|
|
|
|
machine.succeed("ln -s ${redis.servers."".unixSocket} /tmp/redis.sock")
|
2021-06-24 21:34:03 +00:00
|
|
|
|
|
|
|
tests = machine.succeed("PYTHONPATH=\"${pkgs.python3Packages.txredisapi.src}\" python -m twisted.trial ${pkgs.python3Packages.txredisapi.src}/tests")
|
|
|
|
'';
|
|
|
|
})
|