nixpkgs/nixos/tests/mpv.nix
Alexandre Macabies c9e991bd64 mpvScripts.simple-mpv-webui: 1.0.0 -> 2.1.0
This also adds a test. The current packaged version (1.0.0) is broken,
it cannot find relevant files.
2021-08-01 00:47:55 +02:00

29 lines
618 B
Nix

import ./make-test-python.nix ({ lib, ... }:
with lib;
let
port = toString 4321;
in
{
name = "mpv";
meta.maintainers = with maintainers; [ zopieux ];
nodes.machine =
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.curl
(pkgs.mpv-with-scripts.override {
scripts = [ pkgs.mpvScripts.simple-mpv-webui ];
})
];
};
testScript = ''
machine.execute("set -m; mpv --script-opts=webui-port=${port} --idle=yes &")
machine.wait_for_open_port(${port})
assert "<title>simple-mpv-webui" in machine.succeed("curl -s localhost:${port}")
'';
})