Lines Matching refs:assertRaises
197 self.assertRaises(UnicodeDecodeError, sin.decode,
211 self.assertRaises(UnicodeError, codecs.charmap_encode, sin, "strict", charmap)
219 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
222 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
225 self.assertRaises(
329 self.assertRaises(TypeError, exctype, *args[:-1])
331 self.assertRaises(TypeError, exctype, *(args + ["too much"]))
345 self.assertRaises(TypeError, exctype, *callargs)
426 self.assertRaises(
432 self.assertRaises(
439 self.assertRaises(
444 self.assertRaises(
449 self.assertRaises(
457 self.assertRaises(
463 self.assertRaises(
487 self.assertRaises(
493 self.assertRaises(
498 self.assertRaises(
503 self.assertRaises(
527 self.assertRaises(
533 self.assertRaises(
539 self.assertRaises(
544 self.assertRaises(
565 self.assertRaises(
571 self.assertRaises(
577 self.assertRaises(
582 self.assertRaises(
625 self.assertRaises(
637 self.assertRaises(
665 self.assertRaises(
676 self.assertRaises(TypeError, codecs.register_error, 42)
677 self.assertRaises(TypeError, codecs.register_error, "test.dummy", 42)
682 self.assertRaises(TypeError, codecs.lookup_error)
687 self.assertRaises(LookupError, codecs.lookup_error, "test.unknown")
706 self.assertRaises(LookupError, "\xff".decode, "ascii", "test.unknown")
711 self.assertRaises(TypeError, "\xff".decode, "ascii", "test.baddecodereturn1")
712 self.assertRaises(TypeError, "\\".decode, "unicode-escape", "test.baddecodereturn1")
713 self.assertRaises(TypeError, "\\x0".decode, "unicode-escape", "test.baddecodereturn1")
714 self.assertRaises(TypeError, "\\x0y".decode, "unicode-escape", "test.baddecodereturn1")
715 … self.assertRaises(TypeError, "\\Uffffeeee".decode, "unicode-escape", "test.baddecodereturn1")
716 … self.assertRaises(TypeError, "\\uyyyy".decode, "raw-unicode-escape", "test.baddecodereturn1")
721 self.assertRaises(TypeError, "\xff".decode, "ascii", "test.baddecodereturn2")
736 self.assertRaises(IndexError, "\xff0".decode, "ascii", "test.posreturn")
748 self.assertRaises(IndexError, "\xff0".decode, "ascii", "test.posreturn")
757 self.assertRaises(UnicodeError, codecs.charmap_decode, "\xff", "strict", {0xff: None})
758 self.assertRaises(ValueError, codecs.charmap_decode, "\xff", "strict", D())
759 self.assertRaises(TypeError, codecs.charmap_decode, "\xff", "strict", {0xff: 0x110000})
765 self.assertRaises(LookupError, u"\xff".encode, "ascii", "test.unknown")
770 self.assertRaises(TypeError, u"\xff".encode, "ascii", "test.badencodereturn1")
775 self.assertRaises(TypeError, u"\xff".encode, "ascii", "test.badencodereturn2")
790 self.assertRaises(IndexError, u"\xff0".encode, "ascii", "test.posreturn")
802 self.assertRaises(IndexError, u"\xff0".encode, "ascii", "test.posreturn")
810 self.assertRaises(UnicodeError, codecs.charmap_encode, u"\xff", err, {0xff: None})
811 self.assertRaises(ValueError, codecs.charmap_encode, u"\xff", err, D())
812 self.assertRaises(TypeError, codecs.charmap_encode, u"\xff", err, {0xff: 300})
823 self.assertRaises(ValueError, u"\xff".translate, D())
824 self.assertRaises(TypeError, u"\xff".translate, {0xff: sys.maxunicode+1})
825 self.assertRaises(TypeError, u"\xff".translate, {0xff: ()})
851 self.assertRaises(TypeError, handler, FakeUnicodeError())
855 with self.assertRaises((TypeError, FakeUnicodeError)):