import logging
import sys
import unittest
import mock

logger = logging.getLogger()
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
stream_handler = logging.StreamHandler(sys.stderr)
logger.addHandler(stream_handler)

class WebdriverRemoteMock(mock.Mock, unittest.TestCase):
    #def __init__(self, *args, **kwargs):
    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=None, browser_profile=None, proxy=None, keep_alive=False):
        super(WebdriverRemoteMock, self).__init__()
        self._appiumUrl = command_executor
        self._desCapa = desired_capabilities
        self._dead = False
        #logger.debug(desired_capabilities)
        for key in desired_capabilities:
            self.assertNotEqual(desired_capabilities[key], None, 'Null value in desired capabilities')
      
    def _get_child_mock(self, **kwargs):
        return mock.Mock(**kwargs)
    
    # quit() and lock() methods for simulating the situations where applications
    # are called after they have been closed.
    # Needed because of a robot.utils.ConnectionCache manages the closed connections in a weird way
    # - see comments in test_MAC_closeApplication_failed() below
    def quit(self, **kwargs):
        self._dead = True

    def lock(self):
        if self._dead:
            raise RuntimeError('Application has been closed')



    

525bd0a9f995162255a34b1477d904c482fd0ec5
<mask token>


class WebdriverRemoteMock(mock.Mock, unittest.TestCase):

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
        desired_capabilities=None, browser_profile=None, proxy=None,
        keep_alive=False):
        super(WebdriverRemoteMock, self).__init__()
        self._appiumUrl = command_executor
        self._desCapa = desired_capabilities
        self._dead = False
        for key in desired_capabilities:
            self.assertNotEqual(desired_capabilities[key], None,
                'Null value in desired capabilities')

    def _get_child_mock(self, **kwargs):
        return mock.Mock(**kwargs)

    def quit(self, **kwargs):
        self._dead = True

    def lock(self):
        if self._dead:
            raise RuntimeError('Application has been closed')

<mask token>
logger.addHandler(stream_handler)
<mask token>
logger.addHandler(stream_handler)


class WebdriverRemoteMock(mock.Mock, unittest.TestCase):

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
        desired_capabilities=None, browser_profile=None, proxy=None,
        keep_alive=False):
        super(WebdriverRemoteMock, self).__init__()
        self._appiumUrl = command_executor
        self._desCapa = desired_capabilities
        self._dead = False
        for key in desired_capabilities:
            self.assertNotEqual(desired_capabilities[key], None,
                'Null value in desired capabilities')

    def _get_child_mock(self, **kwargs):
        return mock.Mock(**kwargs)

    def quit(self, **kwargs):
        self._dead = True

    def lock(self):
        if self._dead:
            raise RuntimeError('Application has been closed')

<mask token>
logger = logging.getLogger()
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
stream_handler = logging.StreamHandler(sys.stderr)
logger.addHandler(stream_handler)


class WebdriverRemoteMock(mock.Mock, unittest.TestCase):

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
        desired_capabilities=None, browser_profile=None, proxy=None,
        keep_alive=False):
        super(WebdriverRemoteMock, self).__init__()
        self._appiumUrl = command_executor
        self._desCapa = desired_capabilities
        self._dead = False
        for key in desired_capabilities:
            self.assertNotEqual(desired_capabilities[key], None,
                'Null value in desired capabilities')

    def _get_child_mock(self, **kwargs):
        return mock.Mock(**kwargs)

    def quit(self, **kwargs):
        self._dead = True

    def lock(self):
        if self._dead:
            raise RuntimeError('Application has been closed')

import logging
import sys
import unittest
import mock
logger = logging.getLogger()
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
stream_handler = logging.StreamHandler(sys.stderr)
logger.addHandler(stream_handler)


class WebdriverRemoteMock(mock.Mock, unittest.TestCase):

    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
        desired_capabilities=None, browser_profile=None, proxy=None,
        keep_alive=False):
        super(WebdriverRemoteMock, self).__init__()
        self._appiumUrl = command_executor
        self._desCapa = desired_capabilities
        self._dead = False
        for key in desired_capabilities:
            self.assertNotEqual(desired_capabilities[key], None,
                'Null value in desired capabilities')

    def _get_child_mock(self, **kwargs):
        return mock.Mock(**kwargs)

    def quit(self, **kwargs):
        self._dead = True

    def lock(self):
        if self._dead:
            raise RuntimeError('Application has been closed')

import logging
import sys
import unittest
import mock

logger = logging.getLogger()
stream_handler = logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
stream_handler = logging.StreamHandler(sys.stderr)
logger.addHandler(stream_handler)

class WebdriverRemoteMock(mock.Mock, unittest.TestCase):
    #def __init__(self, *args, **kwargs):
    def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=None, browser_profile=None, proxy=None, keep_alive=False):
        super(WebdriverRemoteMock, self).__init__()
        self._appiumUrl = command_executor
        self._desCapa = desired_capabilities
        self._dead = False
        #logger.debug(desired_capabilities)
        for key in desired_capabilities:
            self.assertNotEqual(desired_capabilities[key], None, 'Null value in desired capabilities')
      
    def _get_child_mock(self, **kwargs):
        return mock.Mock(**kwargs)
    
    # quit() and lock() methods for simulating the situations where applications
    # are called after they have been closed.
    # Needed because of a robot.utils.ConnectionCache manages the closed connections in a weird way
    # - see comments in test_MAC_closeApplication_failed() below
    def quit(self, **kwargs):
        self._dead = True

    def lock(self):
        if self._dead:
            raise RuntimeError('Application has been closed')



    
