TestBatchCommandProcessor with #INSERT
This commit is contained in:
parent
de5073e916
commit
09825c2a6d
1 changed files with 21 additions and 12 deletions
|
|
@ -43,18 +43,27 @@ class TestBatchCommandProcessor(TestCase):
|
||||||
|
|
||||||
@mock.patch.object(batchprocessors, 'read_batchfile')
|
@mock.patch.object(batchprocessors, 'read_batchfile')
|
||||||
def test_parses_INSERT(self, mocked_read):
|
def test_parses_INSERT(self, mocked_read):
|
||||||
mocked_read.return_value = textwrap.dedent(
|
mocked_read.side_effect = [
|
||||||
r"""
|
textwrap.dedent(r"""
|
||||||
#INSERT another.ev
|
@create sky
|
||||||
#
|
#
|
||||||
|
#INSERT another.ev
|
||||||
""")
|
#
|
||||||
mocked_read.return_value = textwrap.dedent(r"""
|
@create sun
|
||||||
@create bird
|
#
|
||||||
#
|
"""),
|
||||||
""")
|
textwrap.dedent(r"""
|
||||||
|
@create bird
|
||||||
|
#
|
||||||
|
@create cloud
|
||||||
|
#
|
||||||
|
""")
|
||||||
|
]
|
||||||
commands = batchprocessors.BATCHCMD.parse_file('foopath')
|
commands = batchprocessors.BATCHCMD.parse_file('foopath')
|
||||||
self.assertEqual(
|
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