yq: Add test
This commit is contained in:
parent
9e6737710c
commit
648eece4bf
3 changed files with 16 additions and 0 deletions
|
@ -411,6 +411,7 @@ in
|
|||
xterm = handleTest ./xterm.nix {};
|
||||
yabar = handleTest ./yabar.nix {};
|
||||
yggdrasil = handleTest ./yggdrasil.nix {};
|
||||
yq = handleTest ./yq.nix {};
|
||||
zfs = handleTest ./zfs.nix {};
|
||||
zigbee2mqtt = handleTest ./zigbee2mqtt.nix {};
|
||||
zoneminder = handleTest ./zoneminder.nix {};
|
||||
|
|
12
nixos/tests/yq.nix
Normal file
12
nixos/tests/yq.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "yq";
|
||||
meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ nequissimus ]; };
|
||||
|
||||
nodes.yq = { pkgs, ... }: { environment.systemPackages = with pkgs; [ jq yq ]; };
|
||||
|
||||
testScript = ''
|
||||
assert "hello:\n foo: bar\n" in yq.succeed(
|
||||
'echo \'{"hello":{"foo":"bar"}}\' | yq -y .'
|
||||
)
|
||||
'';
|
||||
})
|
|
@ -1,4 +1,5 @@
|
|||
{ lib
|
||||
, nixosTests
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, pkgs
|
||||
|
@ -46,6 +47,8 @@ buildPythonPackage rec {
|
|||
|
||||
pythonImportsCheck = [ "yq" ];
|
||||
|
||||
passthru.tests = { inherit (nixosTests) yq; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "Command-line YAML processor - jq wrapper for YAML documents";
|
||||
homepage = "https://github.com/kislyuk/yq";
|
||||
|
|
Loading…
Reference in a new issue