MCPcopy Index your code
hub / github.com/python/cpython / test_encoding_param

Method test_encoding_param

Lib/test/test_ftplib.py:845–859  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

843 self.assertRaises(ftplib.Error, self.client.storlines, 'stor', f)
844
845 def test_encoding_param(self):
846 encodings = ['latin-1', 'utf-8']
847 for encoding in encodings:
848 with self.subTest(encoding=encoding):
849 self.tearDown()
850 self.setUp(encoding=encoding)
851 self.assertEqual(encoding, self.client.encoding)
852 self.test_retrbinary()
853 self.test_storbinary()
854 self.test_retrlines()
855 new_dir = self.client.mkd('/non-ascii dir \xAE')
856 self.check_data(new_dir, '/non-ascii dir \xAE')
857 # Check default encoding
858 client = ftplib.FTP(timeout=TIMEOUT)
859 self.assertEqual(DEFAULT_ENCODING, client.encoding)
860
861
862@skipUnless(socket_helper.IPV6_ENABLED, "IPv6 not enabled")

Callers

nothing calls this directly

Calls 9

tearDownMethod · 0.95
setUpMethod · 0.95
test_retrbinaryMethod · 0.95
test_storbinaryMethod · 0.95
test_retrlinesMethod · 0.95
check_dataMethod · 0.95
mkdMethod · 0.80
subTestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected