Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(81548)

Side by Side Diff: Lib/test/test_base64.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/support/script_helper.py ('k') | Lib/test/test_capi.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import unittest 1 import unittest
2 from test import support 2 from test import support
3 import base64 3 import base64
4 import binascii 4 import binascii
5 import os 5 import os
6 from array import array 6 from array import array
7 from test.support import script_helper 7 from test.support import script_helper
8 8
9 9
10 class LegacyBase64TestCase(unittest.TestCase): 10 class LegacyBase64TestCase(unittest.TestCase):
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 base64.b32decode, 627 base64.b32decode,
628 base64.b16decode, 628 base64.b16decode,
629 base64.b85decode, 629 base64.b85decode,
630 base64.a85decode) 630 base64.a85decode)
631 for f in decode_funcs: 631 for f in decode_funcs:
632 self.assertRaises(ValueError, f, 'with non-ascii \xcb') 632 self.assertRaises(ValueError, f, 'with non-ascii \xcb')
633 633
634 def test_ErrorHeritage(self): 634 def test_ErrorHeritage(self):
635 self.assertTrue(issubclass(binascii.Error, ValueError)) 635 self.assertTrue(issubclass(binascii.Error, ValueError))
636 636
637 637 @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Pop en()")
638 class TestMain(unittest.TestCase): 638 class TestMain(unittest.TestCase):
639 def tearDown(self): 639 def tearDown(self):
640 if os.path.exists(support.TESTFN): 640 if os.path.exists(support.TESTFN):
641 os.unlink(support.TESTFN) 641 os.unlink(support.TESTFN)
642 642
643 def get_output(self, *args): 643 def get_output(self, *args):
644 return script_helper.assert_python_ok('-m', 'base64', *args).out 644 return script_helper.assert_python_ok('-m', 'base64', *args).out
645 645
646 def test_encode_decode(self): 646 def test_encode_decode(self):
647 output = self.get_output('-t') 647 output = self.get_output('-t')
(...skipping 16 matching lines...) Expand all
664 self.assertIsNone(err) 664 self.assertIsNone(err)
665 665
666 def test_decode(self): 666 def test_decode(self):
667 with open(support.TESTFN, 'wb') as fp: 667 with open(support.TESTFN, 'wb') as fp:
668 fp.write(b'Yf9iCg==') 668 fp.write(b'Yf9iCg==')
669 output = self.get_output('-d', support.TESTFN) 669 output = self.get_output('-d', support.TESTFN)
670 self.assertEqual(output.rstrip(), b'a\xffb') 670 self.assertEqual(output.rstrip(), b'a\xffb')
671 671
672 if __name__ == '__main__': 672 if __name__ == '__main__':
673 unittest.main() 673 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/support/script_helper.py ('k') | Lib/test/test_capi.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+