mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 02:06:32 +01:00
TestBatchCommandProcessor with #INSERT
This commit is contained in:
parent
31d3f92810
commit
f1bfae9bc7
1 changed files with 21 additions and 12 deletions
|
|
@ -43,18 +43,27 @@ class TestBatchCommandProcessor(TestCase):
|
|||
|
||||
@mock.patch.object(batchprocessors, 'read_batchfile')
|
||||
def test_parses_INSERT(self, mocked_read):
|
||||
mocked_read.return_value = textwrap.dedent(
|
||||
r"""
|
||||
#INSERT another.ev
|
||||
#
|
||||
|
||||
""")
|
||||
mocked_read.return_value = textwrap.dedent(r"""
|
||||
@create bird
|
||||
#
|
||||
""")
|
||||
mocked_read.side_effect = [
|
||||
textwrap.dedent(r"""
|
||||
@create sky
|
||||
#
|
||||
#INSERT another.ev
|
||||
#
|
||||
@create sun
|
||||
#
|
||||
"""),
|
||||
textwrap.dedent(r"""
|
||||
@create bird
|
||||
#
|
||||
@create cloud
|
||||
#
|
||||
""")
|
||||
]
|
||||
commands = batchprocessors.BATCHCMD.parse_file('foopath')
|
||||
self.assertEqual(
|
||||
['@create bird'],
|
||||
commands)
|
||||
commands,
|
||||
['@create sky', '@create bird', '@create cloud', '@create sun'])
|
||||
self.assertEqual(mocked_read.mock_calls, [
|
||||
mock.call('foopath', file_ending='.ev'),
|
||||
mock.call('another.ev', file_ending='.ev')])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue