forked from github/server
integration test for STUDY.
This commit is contained in:
parent
bfadc4914f
commit
762f1e467b
2 changed files with 34 additions and 0 deletions
|
@ -5,4 +5,5 @@ require "tests.config"
|
||||||
require "tests.locale"
|
require "tests.locale"
|
||||||
require "tests.regions"
|
require "tests.regions"
|
||||||
require "tests.ships"
|
require "tests.ships"
|
||||||
|
require "tests.study"
|
||||||
|
|
||||||
|
|
33
tests/study.lua
Normal file
33
tests/study.lua
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
require "lunit"
|
||||||
|
|
||||||
|
module("tests.eressea.study", package.seeall, lunit.testcase)
|
||||||
|
|
||||||
|
function setup()
|
||||||
|
conf = [[{
|
||||||
|
"races" : { "human" : {} },
|
||||||
|
"terrains" : { "plain" : { "flags" : [ "land" ] } },
|
||||||
|
"keywords" : { "de" : { "study": "LERNEN" } },
|
||||||
|
"skills" : { "de": { "alchemy" : "Alchemie", "crossbow" : "Armbrust" } }
|
||||||
|
}]]
|
||||||
|
eressea.game.reset()
|
||||||
|
eressea.config.reset();
|
||||||
|
eressea.config.parse(conf)
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_study()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local f = faction.create("test@example.com", "human", "de")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
u:add_order("LERNEN Armbrust")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(1, u:get_skill("crossbow"))
|
||||||
|
end
|
||||||
|
|
||||||
|
function dsabled_test_study_expensive()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local f = faction.create("test@example.com", "human", "de")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
u:add_order("LERNEN Alchemie")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(1, u:get_skill("alchemy"))
|
||||||
|
end
|
Loading…
Reference in a new issue