bpo-35970: Add help flag to base64 module (GH-28774)

This continues off rkuska's work from https://github.com/python/cpython/pull/11789 seeing as the patch wasn't updated to add tests.
This commit is contained in:
Ammar Askar 2021-10-06 21:38:43 -04:00 committed by GitHub
parent e6ff4eba6d
commit 5baec4aea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View file

@ -788,5 +788,15 @@ class TestMain(unittest.TestCase):
output = self.get_output('-d', os_helper.TESTFN)
self.assertEqual(output.rstrip(), b'a\xffb')
def test_prints_usage_with_help_flag(self):
output = self.get_output('-h')
self.assertIn(b'usage: ', output)
self.assertIn(b'-d, -u: decode', output)
def test_prints_usage_with_invalid_flag(self):
output = script_helper.assert_python_failure('-m', 'base64', '-x').err
self.assertIn(b'usage: ', output)
self.assertIn(b'-d, -u: decode', output)
if __name__ == '__main__':
unittest.main()