mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-14 05:37:40 +03:00
21 lines
419 B
Nix
21 lines
419 B
Nix
|
import ./make-test-python.nix {
|
||
|
|
||
|
nodes.machine = { ... }: {
|
||
|
services.ntfy-sh.enable = true;
|
||
|
};
|
||
|
|
||
|
testScript = ''
|
||
|
import json
|
||
|
|
||
|
msg = "Test notification"
|
||
|
|
||
|
machine.wait_for_unit("multi-user.target")
|
||
|
|
||
|
machine.succeed(f"curl -d '{msg}' localhost:80/test")
|
||
|
|
||
|
notif = json.loads(machine.succeed("curl -s localhost:80/test/json?poll=1"))
|
||
|
|
||
|
assert msg == notif["message"], "Wrong message"
|
||
|
'';
|
||
|
}
|