@@ -1422,8 +1422,9 @@ def get_output(self, *args):
14221422 def test_encode_file (self ):
14231423 with open (os_helper .TESTFN , 'wb' ) as fp :
14241424 fp .write (b'a\xff b\n ' )
1425- output = self .get_output ('-e' , os_helper .TESTFN )
1426- self .assertEqual (output .rstrip (), b'Yf9iCg==' )
1425+ for flag in ('-e' , '--encode' ):
1426+ output = self .get_output (flag , os_helper .TESTFN )
1427+ self .assertEqual (output .rstrip (), b'Yf9iCg==' )
14271428
14281429 def test_encode_from_stdin (self ):
14291430 with script_helper .spawn_python ('-m' , 'base64' , '-e' ) as proc :
@@ -1434,13 +1435,15 @@ def test_encode_from_stdin(self):
14341435 def test_decode (self ):
14351436 with open (os_helper .TESTFN , 'wb' ) as fp :
14361437 fp .write (b'Yf9iCg==' )
1437- output = self .get_output ('-d' , os_helper .TESTFN )
1438- self .assertEqual (output .rstrip (), b'a\xff b' )
1438+ for flag in ('-d' , '--decode' ):
1439+ output = self .get_output (flag , os_helper .TESTFN )
1440+ self .assertEqual (output .rstrip (), b'a\xff b' )
14391441
14401442 def test_prints_usage_with_help_flag (self ):
1441- output = self .get_output ('-h' )
1442- self .assertIn (b'usage: ' , output )
1443- self .assertIn (b'-d' , output )
1443+ for flag in ('-h' , '--help' ):
1444+ output = self .get_output (flag )
1445+ self .assertIn (b'usage: ' , output )
1446+ self .assertIn (b'-d' , output )
14441447
14451448 def test_prints_usage_with_invalid_flag (self ):
14461449 output = script_helper .assert_python_failure ('-m' , 'base64' , '-x' ).err
0 commit comments