tests: clean up tests
- Move all module tests to their own directories. - Avoid duplication of `// import`.
This commit is contained in:
parent
fba87f8998
commit
de8033747c
17 changed files with 54 additions and 36 deletions
3
tests/modules/programs/mbsync/default.nix
Normal file
3
tests/modules/programs/mbsync/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
mbsync = ./mbsync.nix;
|
||||
}
|
||||
55
tests/modules/programs/mbsync/mbsync-expected.conf
Normal file
55
tests/modules/programs/mbsync/mbsync-expected.conf
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# Generated by Home Manager.
|
||||
|
||||
IMAPAccount hm-account
|
||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||
Host imap.example.org
|
||||
PassCmd "password-command 2"
|
||||
SSLType IMAPS
|
||||
User home.manager.jr
|
||||
|
||||
IMAPStore hm-account-remote
|
||||
Account hm-account
|
||||
|
||||
MaildirStore hm-account-local
|
||||
Inbox /home/hm-user/Mail/hm-account/Inbox
|
||||
Path /home/hm-user/Mail/hm-account/
|
||||
SubFolders Verbatim
|
||||
|
||||
Channel hm-account
|
||||
Create None
|
||||
Expunge None
|
||||
Master :hm-account-remote:
|
||||
Patterns *
|
||||
Remove None
|
||||
Slave :hm-account-local:
|
||||
SyncState *
|
||||
|
||||
|
||||
IMAPAccount hm@example.com
|
||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
||||
Host imap.example.com
|
||||
PassCmd password-command
|
||||
SSLType IMAPS
|
||||
User home.manager
|
||||
|
||||
IMAPStore hm@example.com-remote
|
||||
Account hm@example.com
|
||||
|
||||
MaildirStore hm@example.com-local
|
||||
Inbox /home/hm-user/Mail/hm@example.com/Inbox
|
||||
Path /home/hm-user/Mail/hm@example.com/
|
||||
SubFolders Verbatim
|
||||
|
||||
Channel hm@example.com
|
||||
Create None
|
||||
Expunge None
|
||||
Master :hm@example.com-remote:
|
||||
Patterns *
|
||||
Remove None
|
||||
Slave :hm@example.com-local:
|
||||
SyncState *
|
||||
|
||||
|
||||
Group inboxes
|
||||
Channel hm-account:Inbox
|
||||
Channel hm@example.com:Inbox1,Inbox2
|
||||
35
tests/modules/programs/mbsync/mbsync.nix
Normal file
35
tests/modules/programs/mbsync/mbsync.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
home.username = "hm-user";
|
||||
home.homeDirectory = "/home/hm-user";
|
||||
|
||||
programs.mbsync = {
|
||||
enable = true;
|
||||
groups.inboxes = {
|
||||
"hm@example.com" = [ "Inbox1" "Inbox2" ];
|
||||
hm-account = [ "Inbox" ];
|
||||
};
|
||||
};
|
||||
|
||||
accounts.email.accounts = {
|
||||
"hm@example.com".mbsync = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
hm-account.mbsync = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.mbsyncrc
|
||||
assertFileContent home-files/.mbsyncrc ${./mbsync-expected.conf}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue