forked from mirrors/nixpkgs
nixosTests.mailcatcher: Port tests to python
This commit is contained in:
parent
23d164edb4
commit
1f2030fdcb
|
@ -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"
|
||||
)
|
||||
'';
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue