示例#1
0
 def test12(self, mock_stdout):
     with mock.patch('builtins.input',
                     return_value='/abc/def    ../gh///../klm/.'):
         my_cd()
         self.assertEqual(mock_stdout.getvalue(), '/abc/klm\n')
示例#2
0
 def test1(self, mock_stdout):
     with mock.patch('builtins.input', return_value='/ abc'):
         my_cd()
         self.assertEqual(mock_stdout.getvalue(), '/abc\n')
示例#3
0
 def test11(self, mock_stdout):
     with mock.patch('builtins.input', return_value='/abc/def   ......'):
         my_cd()
         self.assertEqual(mock_stdout.getvalue(),
                          '......: No such file or directory\n')