nixpkgs/nixos/tests/txredisapi.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
836 B
Nix
Raw Normal View History

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