nixos-config/tests/lib/data/default.nix

34 lines
716 B
Nix
Raw Normal View History

2024-06-09 15:03:26 +00:00
{ pkgs, lib, self }:
lib.runTests {
testImportYAML = {
expr = self.data.importYAML ./data/sample.yaml;
expected = {
hello = "world";
whoa = 4566;
list-of-names = [
"Cheesy" "Angry" "Ash"
];
};
};
testImportYAMLAsJSON = {
expr = self.data.importYAML ./data/sample.json;
expected = {
hello = "world";
whoa = 4566;
list-of-names = [
"Cheesy" "Angry" "Ash"
];
};
};
testRenderTeraTemplate = {
expr = builtins.readFile (self.data.renderTeraTemplate {
template = ./templates/sample.tera;
context = lib.importJSON ./data/sample.json;
});
expected = builtins.readFile ./fixtures/sample.tera;
};
}