Exemplo n.º 1
0
 def testGetUnicode(self):
     """Try a couple of zscii-to-unicode conversions, involving
     various ranges of the output spectrum."""
     z = zstring.ZsciiTranslator(make_zmemory())
     self.assertEqual(z.ztou(97), "a")
     self.assertEqual(z.ztou(10), "\n")
     self.assertEqual(z.ztou(168), "\xcf")
     self.assertRaises(IndexError, z.ztou, z.CUR_UP)
Exemplo n.º 2
0
 def testGetZscii(self):
     """Try a couple of unicode-to-zscii conversions, involving
     various ranges of the input spectrum."""
     z = zstring.ZsciiTranslator(make_zmemory())
     self.assertEqual(z.utoz("a"), 97)
     self.assertEqual(z.utoz("\n"), 10)
     self.assertEqual(z.utoz("\xcf"), 168)
     self.assertEqual(z.utoz(z.CUR_UP), 129)
     self.assertEqual(z.utoz(z.MOUSE_CLICK), 254)
Exemplo n.º 3
0
 def testCreateTranslator(self):
     """Test that the ZSCII translator can be instanciated
     correctly."""
     z = zstring.ZsciiTranslator(make_zmemory())