summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Cairns <jon@joncairns.com>2013-01-23 14:47:38 +0000
committerJon Cairns <jon@ggapps.co.uk>2013-01-23 14:47:38 +0000
commit66972840f1858ac6136028d67b47fb41e2116dcd (patch)
tree1524e6e41c6f31ad0c2353801a3157391844c604 /tests
parentda57e6c21ecdaf3ec91bb4e19d0b86e9f198f869 (diff)
downloadvdebug-66972840f1858ac6136028d67b47fb41e2116dcd.zip
Fix tests for breakpoint, raising exception as in #27
Diffstat (limited to 'tests')
-rw-r--r--tests/test_breakpoint_breakpoint.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_breakpoint_breakpoint.py b/tests/test_breakpoint_breakpoint.py
index f66177e..bf825b7 100644
--- a/tests/test_breakpoint_breakpoint.py
+++ b/tests/test_breakpoint_breakpoint.py
@@ -108,10 +108,19 @@ class BreakpointTest(unittest.TestCase):
def test_parse_with_line_breakpoint(self):
""" Test that a LineBreakpoint is created."""
+ Mock.__len__ = Mock(return_value=1)
ui = Mock()
ret = vdebug.breakpoint.Breakpoint.parse(ui,"")
self.assertIsInstance(ret,vdebug.breakpoint.LineBreakpoint)
+ def test_parse_with_empty_line_raises_error(self):
+ """ Test that a LineBreakpoint is created."""
+ Mock.__len__ = Mock(return_value=0)
+ ui = Mock()
+ re = 'Cannot set a breakpoint on an empty line'
+ self.assertRaisesRegexp(vdebug.breakpoint.BreakpointError,\
+ re,vdebug.breakpoint.Breakpoint.parse,ui,"")
+
def test_parse_with_conditional_breakpoint(self):
""" Test that a ConditionalBreakpoint is created."""
ui = Mock()