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')
def test1(self, mock_stdout): with mock.patch('builtins.input', return_value='/ abc'): my_cd() self.assertEqual(mock_stdout.getvalue(), '/abc\n')
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')