diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-06-09 11:56:29 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-06-09 11:56:29 +0100 |
commit | a91ac948b037f58217d89553fa031a18960b9623 (patch) | |
tree | 854a96f1d2d3fb3a58411ac6ae661a089a6ae607 /yarnlib/block_parser_tests.py | |
parent | 7fdb775486405a334b2f0db4e47eac9c7ed53023 (diff) | |
download | cmdtest-a91ac948b037f58217d89553fa031a18960b9623.tar.gz |
Implement BlockParser
Diffstat (limited to 'yarnlib/block_parser_tests.py')
-rw-r--r-- | yarnlib/block_parser_tests.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/yarnlib/block_parser_tests.py b/yarnlib/block_parser_tests.py index 1c14a80..ff1feab 100644 --- a/yarnlib/block_parser_tests.py +++ b/yarnlib/block_parser_tests.py @@ -42,17 +42,17 @@ class BlockParserTests(unittest.TestCase): self.assertEqual(len(story.steps), 3) self.assertEqual(story.steps[0].what, 'GIVEN') self.assertEqual(story.steps[0].text, 'bar') - self.assertEqual(story.steps[0].what, 'WHEN') - self.assertEqual(story.steps[0].text, 'foobar') - self.assertEqual(story.steps[0].what, 'THEN') - self.assertEqual(story.steps[0].text, 'yoyo') + self.assertEqual(story.steps[1].what, 'WHEN') + self.assertEqual(story.steps[1].text, 'foobar') + self.assertEqual(story.steps[2].what, 'THEN') + self.assertEqual(story.steps[2].text, 'yoyo') def test_normalises_whitespace(self): - self.parser.parse_code_blocks(['STORY foo bar ']) + self.parser.parse_blocks(['STORY foo bar ']) self.assertEqual(self.parser.stories[0].name, 'foo bar') def test_parses_implements_in_a_block_by_itself(self): - self.parser.parse_code_blocks(['IMPLEMENTS GIVEN foo\ntrue']) + self.parser.parse_blocks(['IMPLEMENTS GIVEN foo\ntrue']) impls = self.parser.implementations self.assertEqual(len(impls), 1) self.assertEqual(impls[0].what, 'GIVEN') @@ -60,7 +60,7 @@ class BlockParserTests(unittest.TestCase): self.assertEqual(impls[0].shell, 'true') def test_parses_two_implements_in_a_code_block(self): - self.parser.parse_code_blocks( + self.parser.parse_blocks( ['IMPLEMENTS GIVEN foo\ntrue\nIMPLEMENTS WHEN bar\ncat /dev/null']) impls = self.parser.implementations self.assertEqual(len(impls), 2) |