mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Add Script test with repeats=1 and start_delay=True
This commit is contained in:
parent
7e7ffbe3ab
commit
68e93bbe9a
1 changed files with 19 additions and 6 deletions
|
|
@ -84,6 +84,7 @@ class TestCreateScript(EvenniaTest):
|
|||
assert script is not None
|
||||
assert script.interval == 10
|
||||
assert script.key == 'test_script'
|
||||
script.stop()
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_create_script_w_repeats_equal_1(self):
|
||||
|
|
@ -94,14 +95,12 @@ class TestCreateScript(EvenniaTest):
|
|||
self.repeats = 1
|
||||
self.persistent = False
|
||||
|
||||
# import ipdb
|
||||
# ipdb.set_trace()
|
||||
|
||||
script = create.create_script(TestScriptB, key='test_script')
|
||||
assert script is not None
|
||||
assert script.interval == 10
|
||||
assert script.repeats == 1
|
||||
assert script.key == 'test_script'
|
||||
script.stop()
|
||||
|
||||
def test_create_script_w_repeats_equal_2(self):
|
||||
class TestScriptC(DefaultScript):
|
||||
|
|
@ -111,11 +110,25 @@ class TestCreateScript(EvenniaTest):
|
|||
self.repeats = 2
|
||||
self.persistent = False
|
||||
|
||||
# import ipdb
|
||||
# ipdb.set_trace()
|
||||
|
||||
script = create.create_script(TestScriptC, key='test_script')
|
||||
assert script is not None
|
||||
assert script.interval == 10
|
||||
assert script.repeats == 2
|
||||
assert script.key == 'test_script'
|
||||
script.stop()
|
||||
|
||||
def test_create_script_w_repeats_equal_1_and_delayed(self):
|
||||
class TestScriptD(DefaultScript):
|
||||
def at_script_creation(self):
|
||||
self.key = 'test_script'
|
||||
self.interval = 10
|
||||
self.start_delay = True
|
||||
self.repeats = 1
|
||||
self.persistent = False
|
||||
|
||||
script = create.create_script(TestScriptD, key='test_script')
|
||||
assert script is not None
|
||||
assert script.interval == 10
|
||||
assert script.repeats == 1
|
||||
assert script.key == 'test_script'
|
||||
script.stop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue