(self)
| 4996 | self.assertRaises(ValueError, self._test_encode, '', '', maxlinelen=3) |
| 4997 | |
| 4998 | def test_encode(self): |
| 4999 | eq = self.assertEqual |
| 5000 | eq(quoprimime.body_encode(''), '') |
| 5001 | eq(quoprimime.body_encode('hello'), 'hello') |
| 5002 | # Test the binary flag |
| 5003 | eq(quoprimime.body_encode('hello\r\nworld'), 'hello\nworld') |
| 5004 | # Test the maxlinelen arg |
| 5005 | eq(quoprimime.body_encode('xxxx ' * 20, maxlinelen=40), """\ |
| 5006 | xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx= |
| 5007 | xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx= |
| 5008 | x xxxx xxxx xxxx xxxx=20""") |
| 5009 | # Test the eol argument |
| 5010 | eq(quoprimime.body_encode('xxxx ' * 20, maxlinelen=40, eol='\r\n'), |
| 5011 | """\ |
| 5012 | xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx=\r |
| 5013 | xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxx=\r |
| 5014 | x xxxx xxxx xxxx xxxx=20""") |
| 5015 | eq(quoprimime.body_encode("""\ |
| 5016 | one line |
| 5017 | |
| 5018 | two line"""), """\ |
| 5019 | one line |
| 5020 | |
| 5021 | two line""") |
| 5022 | |
| 5023 | |
| 5024 |
nothing calls this directly
no test coverage detected