1
0
mirror of https://github.com/mnaberez/py65.git synced 2024-09-29 22:56:17 +00:00

Show help when add_label is given incorrect args

This commit is contained in:
Mike Naberezny 2012-02-10 19:20:52 -08:00
parent 02ff83d18b
commit 41883160f8
2 changed files with 3 additions and 2 deletions

View File

@ -627,7 +627,7 @@ class Monitor(cmd.Cmd):
split = shlex.split(args)
if len(split) != 2:
self._output("Syntax error: %s" % args)
return
return self.help_add_label()
address = self._address_parser.number(split[0])
label = split[1]

View File

@ -55,7 +55,8 @@ class MonitorTests(unittest.TestCase):
mon = Monitor(stdout=stdout)
mon.do_add_label('should be label space value')
out = stdout.getvalue()
self.assertEqual("Syntax error: should be label space value\n", out)
err = "Syntax error: should be label space value\n"
self.assertTrue(out.startswith(err))
def test_do_add_label_adds_label(self):
stdout = StringIO()