summaryrefslogtreecommitdiff
path: root/yarnlib/block_parser_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-06-09 12:09:06 +0100
committerLars Wirzenius <liw@liw.fi>2013-06-09 12:09:06 +0100
commit0f367f13c234495e5f448fe3e42d38ede10400b5 (patch)
treef4e3f45808aaeae60ae738be7461a2d9126b964a /yarnlib/block_parser_tests.py
parenta6c8b66d4c8bc4138dae2a8872b8fa879d1eb2f1 (diff)
downloadcmdtest-0f367f13c234495e5f448fe3e42d38ede10400b5.tar.gz
Add tests for bad IMPLEMENTS lines
Diffstat (limited to 'yarnlib/block_parser_tests.py')
-rw-r--r--yarnlib/block_parser_tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/yarnlib/block_parser_tests.py b/yarnlib/block_parser_tests.py
index 0a1d441..7051e17 100644
--- a/yarnlib/block_parser_tests.py
+++ b/yarnlib/block_parser_tests.py
@@ -104,3 +104,21 @@ class BlockParserTests(unittest.TestCase):
self.assertEqual(impls[1].regexp, 'bar')
self.assertEqual(impls[1].shell, 'cat /dev/null')
+ def test_raises_error_for_implements_with_no_args(self):
+ self.assertRaises(
+ yarnlib.BlockError,
+ self.parser.parse_blocks,
+ ['IMPLEMENTS'])
+
+ def test_raises_error_for_implements_with_one_args(self):
+ self.assertRaises(
+ yarnlib.BlockError,
+ self.parser.parse_blocks,
+ ['IMPLEMENTS GIVEN'])
+
+ def test_raises_error_for_implements_with_first_args_not_a_keyword(self):
+ self.assertRaises(
+ yarnlib.BlockError,
+ self.parser.parse_blocks,
+ ['IMPLEMENTS foo'])
+