nixosTests.mailcatcher: Port tests to python

This commit is contained in:
Christian Kampka
2019-12-16 12:52:30 +01:00
parent 23d164edb4
commit 1f2030fdcb
+10 -6
View File
@@ -1,4 +1,4 @@
import ./make-test.nix ({ lib, ... }: import ./make-test-python.nix ({ lib, ... }:
{ {
name = "mailcatcher"; name = "mailcatcher";
@@ -16,11 +16,15 @@ import ./make-test.nix ({ lib, ... }:
}; };
testScript = '' testScript = ''
startAll; start_all()
$machine->waitForUnit('mailcatcher.service'); machine.wait_for_unit("mailcatcher.service")
$machine->waitForOpenPort('1025'); machine.wait_for_open_port("1025")
$machine->succeed('echo "this is the body of the email" | mail -s "subject" root@example.org'); machine.succeed(
$machine->succeed('curl http://localhost:1080/messages/1.source') =~ /this is the body of the email/ or die; 'echo "this is the body of the email" | mail -s "subject" root@example.org'
)
assert "this is the body of the email" in machine.succeed(
"curl http://localhost:1080/messages/1.source"
)
''; '';
}) })