mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
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 {};
|
xterm = handleTest ./xterm.nix {};
|
||||||
yabar = handleTest ./yabar.nix {};
|
yabar = handleTest ./yabar.nix {};
|
||||||
yggdrasil = handleTest ./yggdrasil.nix {};
|
yggdrasil = handleTest ./yggdrasil.nix {};
|
||||||
|
yq = handleTest ./yq.nix {};
|
||||||
zfs = handleTest ./zfs.nix {};
|
zfs = handleTest ./zfs.nix {};
|
||||||
zigbee2mqtt = handleTest ./zigbee2mqtt.nix {};
|
zigbee2mqtt = handleTest ./zigbee2mqtt.nix {};
|
||||||
zoneminder = handleTest ./zoneminder.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
|
{ lib
|
||||||
|
, nixosTests
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
, pkgs
|
, pkgs
|
||||||
|
@ -46,6 +47,8 @@ buildPythonPackage rec {
|
||||||
|
|
||||||
pythonImportsCheck = [ "yq" ];
|
pythonImportsCheck = [ "yq" ];
|
||||||
|
|
||||||
|
passthru.tests = { inherit (nixosTests) yq; };
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Command-line YAML processor - jq wrapper for YAML documents";
|
description = "Command-line YAML processor - jq wrapper for YAML documents";
|
||||||
homepage = "https://github.com/kislyuk/yq";
|
homepage = "https://github.com/kislyuk/yq";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue