3
0
Fork 0
forked from mirrors/nixpkgs

nixosTests.mailcatcher: Port tests to python

This commit is contained in:
Christian Kampka 2019-12-15 15:21:38 +01:00
parent 23d164edb4
commit 1f2030fdcb
No known key found for this signature in database
GPG key ID: B88E140DB4FE1AA5

View file

@ -1,4 +1,4 @@
import ./make-test.nix ({ lib, ... }:
import ./make-test-python.nix ({ lib, ... }:
{
name = "mailcatcher";
@ -16,11 +16,15 @@ import ./make-test.nix ({ lib, ... }:
};
testScript = ''
startAll;
start_all()
$machine->waitForUnit('mailcatcher.service');
$machine->waitForOpenPort('1025');
$machine->succeed('echo "this is the body of the email" | mail -s "subject" root@example.org');
$machine->succeed('curl http://localhost:1080/messages/1.source') =~ /this is the body of the email/ or die;
machine.wait_for_unit("mailcatcher.service")
machine.wait_for_open_port("1025")
machine.succeed(
'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"
)
'';
})