mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 01:36:32 +01:00
TestBatchCommandProcessor with incorrect #INSERT
This commit is contained in:
parent
09825c2a6d
commit
8af98f0ab0
1 changed files with 19 additions and 0 deletions
|
|
@ -67,3 +67,22 @@ class TestBatchCommandProcessor(TestCase):
|
|||
mock.call('foopath', file_ending='.ev'),
|
||||
mock.call('another.ev', file_ending='.ev')])
|
||||
|
||||
@mock.patch.object(batchprocessors, 'read_batchfile')
|
||||
def test_parses_INSERT_raises_IOError(self, mocked_read):
|
||||
mocked_read.side_effect = [
|
||||
textwrap.dedent(r"""
|
||||
@create sky
|
||||
#
|
||||
#INSERT x
|
||||
#
|
||||
@create sun
|
||||
#
|
||||
"""),
|
||||
IOError
|
||||
]
|
||||
with self.assertRaises(IOError, msg='#INSERT x failed.'):
|
||||
commands = batchprocessors.BATCHCMD.parse_file('foopath')
|
||||
self.assertEqual(mocked_read.mock_calls, [
|
||||
mock.call('foopath', file_ending='.ev'),
|
||||
mock.call('x', file_ending='.ev')])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue