mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 16:57:55 +00:00
43 lines
1004 B
Nix
43 lines
1004 B
Nix
{ 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;
|
|
};
|
|
|
|
testRenderMustacheTemplate = {
|
|
expr = builtins.readFile (self.data.renderTeraTemplate {
|
|
template = ./templates/sample.mustache;
|
|
context = lib.importJSON ./data/sample.json;
|
|
});
|
|
# There the same lol.
|
|
expected = builtins.readFile ./fixtures/sample.tera;
|
|
};
|
|
}
|