Esempio n. 1
0
    def test_get_android_pwd_via_helper_and_fails(self, mock_runner):
        mock_response = mock.Mock()
        mock_response.is_successful.return_value = False

        mock_runner.return_value.get_last_message.return_value = mock_response

        with self.assertRaises(Exception) as _:
            _pwd_android()
        self.assertIsNone(file_manager_state.cwd)
Esempio n. 2
0
    def test_get_android_pwd_via_helper(self, mock_runner):
        mock_response = mock.Mock()
        mock_response.is_successful.return_value = True
        type(mock_response).cwd = '/foo/baz'

        mock_runner.return_value.get_last_message.return_value = mock_response

        self.assertEqual(_pwd_android(), '/foo/baz')
        self.assertEqual(file_manager_state.cwd, '/foo/baz')
    def test_get_android_pwd_via_helper(self, mock_api):
        mock_api.return_value.android_file_cwd.return_value = '/foo/baz'

        self.assertEqual(_pwd_android(), '/foo/baz')
        self.assertEqual(file_manager_state.cwd, '/foo/baz')