mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
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:
parent
e6ff4eba6d
commit
5baec4aea6
3 changed files with 20 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue