Fix schema test
This commit is contained in:
@@ -107,7 +107,6 @@ in
|
|||||||
devShells.inventory-schema = pkgs.mkShell {
|
devShells.inventory-schema = pkgs.mkShell {
|
||||||
inputsFrom = with config.checks; [
|
inputsFrom = with config.checks; [
|
||||||
lib-inventory-examples-cue
|
lib-inventory-examples-cue
|
||||||
lib-inventory-schema
|
|
||||||
lib-inventory-eval
|
lib-inventory-eval
|
||||||
self'.devShells.default
|
self'.devShells.default
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# run these tests via `nix-unit ./test.nix`
|
# run these tests via `nix-unit ./test.nix`
|
||||||
{
|
{
|
||||||
lib ? (import <nixpkgs> { }).lib,
|
lib ? (import <nixpkgs> { }).lib,
|
||||||
slib ? import ./. { inherit lib; },
|
slib ? (import ./. { inherit lib; } { }),
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
parseOption = import ./test_parseOption.nix { inherit lib slib; };
|
parseOption = import ./test_parseOption.nix { inherit lib slib; };
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# run these tests via `nix-unit ./test.nix`
|
# run these tests via `nix-unit ./test.nix`
|
||||||
{
|
{
|
||||||
lib ? (import <nixpkgs> { }).lib,
|
lib ? (import <nixpkgs> { }).lib,
|
||||||
slib ? import ./. { inherit lib; },
|
slib ? (import ./. { inherit lib; } { }),
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
description = "Test Description";
|
description = "Test Description";
|
||||||
@@ -236,7 +236,7 @@ in
|
|||||||
{
|
{
|
||||||
expr = slib.parseOption (evalType (lib.types.nullOr lib.types.bool) default);
|
expr = slib.parseOption (evalType (lib.types.nullOr lib.types.bool) default);
|
||||||
expected = {
|
expected = {
|
||||||
anyOf = [
|
oneOf = [
|
||||||
{ type = "null"; }
|
{ type = "null"; }
|
||||||
{ type = "boolean"; }
|
{ type = "boolean"; }
|
||||||
];
|
];
|
||||||
@@ -251,10 +251,10 @@ in
|
|||||||
{
|
{
|
||||||
expr = slib.parseOption (evalType (lib.types.nullOr (lib.types.nullOr lib.types.bool)) default);
|
expr = slib.parseOption (evalType (lib.types.nullOr (lib.types.nullOr lib.types.bool)) default);
|
||||||
expected = {
|
expected = {
|
||||||
anyOf = [
|
oneOf = [
|
||||||
{ type = "null"; }
|
{ type = "null"; }
|
||||||
{
|
{
|
||||||
anyOf = [
|
oneOf = [
|
||||||
{ type = "null"; }
|
{ type = "null"; }
|
||||||
{ type = "boolean"; }
|
{ type = "boolean"; }
|
||||||
];
|
];
|
||||||
@@ -386,7 +386,7 @@ in
|
|||||||
{
|
{
|
||||||
expr = slib.parseOption (evalType (lib.types.either lib.types.bool lib.types.str) default);
|
expr = slib.parseOption (evalType (lib.types.either lib.types.bool lib.types.str) default);
|
||||||
expected = {
|
expected = {
|
||||||
anyOf = [
|
oneOf = [
|
||||||
{ type = "boolean"; }
|
{ type = "boolean"; }
|
||||||
{ type = "string"; }
|
{ type = "string"; }
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# run these tests via `nix-unit ./test.nix`
|
# run these tests via `nix-unit ./test.nix`
|
||||||
{
|
{
|
||||||
lib ? (import <nixpkgs> { }).lib,
|
lib ? (import <nixpkgs> { }).lib,
|
||||||
slib ? import ./. { inherit lib; },
|
slib ? (import ./. { inherit lib; } { }),
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
testParseOptions = {
|
testParseOptions = {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def machine_schema(
|
|||||||
}};
|
}};
|
||||||
options = fakeMachine.options{"." + ".".join(option_path) if option_path else ""};
|
options = fakeMachine.options{"." + ".".join(option_path) if option_path else ""};
|
||||||
jsonschemaLib = import {Path(__file__).parent / "jsonschema"} {{ inherit lib; }} {{}};
|
jsonschemaLib = import {Path(__file__).parent / "jsonschema"} {{ inherit lib; }} {{}};
|
||||||
jsonschema = jsonschemaLib.parseOptions options;
|
jsonschema = jsonschemaLib.parseOptions options {{}};
|
||||||
in
|
in
|
||||||
jsonschema
|
jsonschema
|
||||||
""",
|
""",
|
||||||
|
|||||||
Reference in New Issue
Block a user