mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-10 22:31:12 +00:00
tests: clean up tests
- Move all module tests to their own directories. - Avoid duplication of `// import`.
This commit is contained in:
3
tests/modules/programs/getmail/default.nix
Normal file
3
tests/modules/programs/getmail/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
getmail = ./getmail.nix;
|
||||
}
|
||||
16
tests/modules/programs/getmail/getmail-expected.conf
Normal file
16
tests/modules/programs/getmail/getmail-expected.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
# Generated by Home-Manager.
|
||||
[retriever]
|
||||
type = SimpleIMAPSSLRetriever
|
||||
server = imap.example.com
|
||||
port = 993
|
||||
username = home.manager
|
||||
password_command = ('password-command')
|
||||
mailboxes = ( 'INBOX', 'Sent', 'Work' )
|
||||
|
||||
[destination]
|
||||
type = MDA_external
|
||||
path = /bin/maildrop
|
||||
|
||||
[options]
|
||||
delete = false
|
||||
read_all = true
|
||||
29
tests/modules/programs/getmail/getmail.nix
Normal file
29
tests/modules/programs/getmail/getmail.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
home.username = "hm-user";
|
||||
home.homeDirectory = "/home/hm-user";
|
||||
|
||||
accounts.email.accounts = {
|
||||
"hm@example.com" = {
|
||||
getmail = {
|
||||
enable = true;
|
||||
mailboxes = ["INBOX" "Sent" "Work"];
|
||||
destinationCommand = "/bin/maildrop";
|
||||
delete = false;
|
||||
};
|
||||
imap.port = 993;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.getmail/getmailhm@example.com
|
||||
assertFileContent home-files/.getmail/getmailhm@example.com ${./getmail-expected.conf}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user