import unittest

from appium import webdriver


class MSiteDefaultBrowserAndroidUITests(unittest.TestCase):

    def setUp(self):

        # Default browser does not exist for android >= 6.0
        desired_caps = {
            'platformName': 'Android',
            'deviceName': 'Android Emulator',
            'appPackage': 'com.android.browser',
            'appActivity': 'com.android.browser.BrowserActivity',
            'avd': 'samsung_galaxy_s6_6.0'
        }
        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

    def test_open_url(self):
        self.driver.get('http://targeturl.com')

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(MSiteDefaultBrowserAndroidUITests)
    unittest.TextTestRunner(verbosity=2).run(suite)

[((18, 22, 18, 84), 'appium.webdriver.Remote', 'webdriver.Remote', ({(18, 39, 18, 69): '"""http://127.0.0.1:4723/wd/hub"""', (18, 71, 18, 83): 'desired_caps'}, {}), "('http://127.0.0.1:4723/wd/hub', desired_caps)", False, 'from appium import webdriver\n'), ((27, 12, 27, 33), 'unittest.TestLoader', 'unittest.TestLoader', ({}, {}), '()', False, 'import unittest\n'), ((28, 4, 28, 40), 'unittest.TextTestRunner', 'unittest.TextTestRunner', (), '', False, 'import unittest\n')]