Test(InventoryPersistence): add persist integration tests
This commit is contained in:
1
pkgs/clan-cli/clan_lib/persist/fixtures/1.json
Normal file
1
pkgs/clan-cli/clan_lib/persist/fixtures/1.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
29
pkgs/clan-cli/clan_lib/persist/fixtures/1.nix
Normal file
29
pkgs/clan-cli/clan_lib/persist/fixtures/1.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ clanLib, lib, ... }:
|
||||
let
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
{
|
||||
# Trying to write into the default
|
||||
options.foo = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "bar";
|
||||
};
|
||||
options.protected = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
}
|
||||
{
|
||||
# Cannot write into the default set prio
|
||||
protected = "protected";
|
||||
}
|
||||
# Merge the "inventory.json"
|
||||
(builtins.fromJSON (builtins.readFile ./1.json))
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
clanInternals.inventoryClass.inventory = eval.config;
|
||||
clanInternals.inventoryClass.introspection = clanLib.introspection.getPrios {
|
||||
options = eval.options;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user