def test_parse_ok(self): self.assertIsInstance(Push.parse(['ax']), Push)
def test_execute(self): p = Push.parse(['ax']) ctx = Context(None) ctx.registers.set(AX, 0x0022) p.execute(ctx) self.assertEqual(ctx.stack.get(0xFFFF)[0], 0x0022)
def test_parse_bad_number_of_arguments(self): self.assertRaises(SyntaxError, lambda: Push.parse(['ax,', '2']))