mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	I thought I had run the full test suite before the last checkin, but obviously I didn't. test_multibytecodec_support.py isn't really a test file, it is a support file that contains a base test class. Rename it to multibytecodec_support so that regrtest test discovery doesn't think it is a test file that should be run.
		
			
				
	
	
		
			46 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
#!/usr/bin/env python
 | 
						|
#
 | 
						|
# Codec encoding tests for ISO 2022 encodings.
 | 
						|
 | 
						|
from test import support
 | 
						|
from test import multibytecodec_support
 | 
						|
import unittest
 | 
						|
 | 
						|
COMMON_CODEC_TESTS = (
 | 
						|
        # invalid bytes
 | 
						|
        (b'ab\xFFcd', 'replace', 'ab\uFFFDcd'),
 | 
						|
        (b'ab\x1Bdef', 'replace', 'ab\x1Bdef'),
 | 
						|
        (b'ab\x1B$def', 'replace', 'ab\uFFFD'),
 | 
						|
    )
 | 
						|
 | 
						|
class Test_ISO2022_JP(multibytecodec_support.TestBase, unittest.TestCase):
 | 
						|
    encoding = 'iso2022_jp'
 | 
						|
    tstring = multibytecodec_support.load_teststring('iso2022_jp')
 | 
						|
    codectests = COMMON_CODEC_TESTS + (
 | 
						|
        (b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
 | 
						|
    )
 | 
						|
 | 
						|
class Test_ISO2022_JP2(multibytecodec_support.TestBase, unittest.TestCase):
 | 
						|
    encoding = 'iso2022_jp_2'
 | 
						|
    tstring = multibytecodec_support.load_teststring('iso2022_jp')
 | 
						|
    codectests = COMMON_CODEC_TESTS + (
 | 
						|
        (b'ab\x1BNdef', 'replace', 'abdef'),
 | 
						|
    )
 | 
						|
 | 
						|
class Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
 | 
						|
    encoding = 'iso2022_kr'
 | 
						|
    tstring = multibytecodec_support.load_teststring('iso2022_kr')
 | 
						|
    codectests = COMMON_CODEC_TESTS + (
 | 
						|
        (b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
 | 
						|
    )
 | 
						|
 | 
						|
    # iso2022_kr.txt cannot be used to test "chunk coding": the escape
 | 
						|
    # sequence is only written on the first line
 | 
						|
    def test_chunkcoding(self):
 | 
						|
        pass
 | 
						|
 | 
						|
def test_main():
 | 
						|
    support.run_unittest(__name__)
 | 
						|
 | 
						|
if __name__ == "__main__":
 | 
						|
    test_main()
 |