tests: clean up tests

- Move all module tests to their own directories.

- Avoid duplication of `// import`.
This commit is contained in:
Robert Helgesson
2020-01-26 12:00:03 +01:00
parent fba87f8998
commit de8033747c
17 changed files with 54 additions and 36 deletions

View File

@@ -0,0 +1,3 @@
{
getmail = ./getmail.nix;
}

View 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

View 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}
'';
};
}