mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-13 18:01:54 -04:00
tests
This commit is contained in:
parent
dff068d75b
commit
e8c7fde4c3
8 changed files with 95 additions and 20 deletions
17
mtt.lua
17
mtt.lua
|
@ -1,15 +1,10 @@
|
|||
mtt.register("send mail", function(callback)
|
||||
-- create "player2"
|
||||
|
||||
mtt.register("setup", function(callback)
|
||||
-- create test players
|
||||
local auth_handler = minetest.get_auth_handler()
|
||||
auth_handler.set_password("player1", "")
|
||||
auth_handler.set_password("player2", "")
|
||||
auth_handler.set_password("player3", "")
|
||||
|
||||
-- send a mail
|
||||
local success, err = mail.send({from = "player1", to = "player2", subject = "something", body = "blah"})
|
||||
assert(success)
|
||||
assert(not err)
|
||||
|
||||
-- check the receivers inbox
|
||||
local entry = mail.get_storage_entry("player2")
|
||||
assert(entry ~= nil and #entry.inbox > 0)
|
||||
callback()
|
||||
end)
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue