pythonPackages.txredisapi: Add unit test
This commit is contained in:
parent
6d90bc1c11
commit
f7f52a4fbf
3 changed files with 30 additions and 0 deletions
|
@ -431,6 +431,7 @@ in
|
|||
trezord = handleTest ./trezord.nix {};
|
||||
trickster = handleTest ./trickster.nix {};
|
||||
trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
|
||||
txredisapi = handleTest ./txredisapi.nix {};
|
||||
tuptime = handleTest ./tuptime.nix {};
|
||||
turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix {};
|
||||
ucarp = handleTest ./ucarp.nix {};
|
||||
|
|
27
nixos/tests/txredisapi.nix
Normal file
27
nixos/tests/txredisapi.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }:
|
||||
{
|
||||
name = "txredisapi";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ dandellion ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
machine =
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.redis.enable = true;
|
||||
services.redis.unixSocket = "/run/redis/redis.sock";
|
||||
|
||||
environment.systemPackages = with pkgs; [ (python38.withPackages (ps: [ ps.twisted ps.txredisapi ps.mock ]))];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_unit("redis")
|
||||
machine.wait_for_open_port("6379")
|
||||
|
||||
tests = machine.succeed("PYTHONPATH=\"${pkgs.python3Packages.txredisapi.src}\" python -m twisted.trial ${pkgs.python3Packages.txredisapi.src}/tests")
|
||||
'';
|
||||
})
|
|
@ -16,6 +16,8 @@ buildPythonPackage rec {
|
|||
doCheck = false;
|
||||
pythonImportsCheck = [ "txredisapi" ];
|
||||
|
||||
passthru.tests.unit-tests = nixosTests.txredisapi;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/IlyaSkriblovsky/txredisapi";
|
||||
description = "non-blocking redis client for python";
|
||||
|
|
Loading…
Reference in a new issue