Exemple #1
0
    def test_user_agent_firefox(self):
        """
        Tests vanilla firefox user agent
        """

        agent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0"
        self.assertFalse(user_agents.is_android_webview(agent))

        agent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"
        self.assertFalse(user_agents.is_android_webview(agent))
    def test_user_agent_firefox(self):
        '''
        Tests vanilla firefox user agent
        '''

        agent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0"
        self.assertFalse(user_agents.is_android_webview(agent))

        agent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"
        self.assertFalse(user_agents.is_android_webview(agent))
Exemple #3
0
    def test_user_agent_chrome(self):
        """
        Tests vanilla chrome user agent
        """

        agent = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"\
                "Chrome/32.0.1667.0 Safari/537.36"
        self.assertFalse(user_agents.is_android_webview(agent))

        agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like "\
                "Gecko) Chrome/32.0.1664.3 Safari/537.36"
        self.assertFalse(user_agents.is_android_webview(agent))
    def test_user_agent_chrome(self):
        '''
        Tests vanilla chrome user agent
        '''

        agent = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)"\
                "Chrome/32.0.1667.0 Safari/537.36"
        self.assertFalse(user_agents.is_android_webview(agent))

        agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like "\
                "Gecko) Chrome/32.0.1664.3 Safari/537.36"
        self.assertFalse(user_agents.is_android_webview(agent))
Exemple #5
0
    def test_user_agent_old_ua(self):
        """
        Tests the old webview user agent
        """

        agent = "Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) AppleWebKit/534.30 "\
                "(KHTML, like Gecko) Version/4.0 Safari/534.30 WgerAndroidWebApp"
        self.assertTrue(user_agents.is_android_webview(agent))
    def test_user_agent_old_ua(self):
        '''
        Tests the old webview user agent
        '''

        agent = "Mozilla/5.0 (Linux; U; Android 4.1.1; en-gb; Build/KLP) AppleWebKit/534.30 "\
                "(KHTML, like Gecko) Version/4.0 Safari/534.30 WgerAndroidWebApp"
        self.assertTrue(user_agents.is_android_webview(agent))
Exemple #7
0
    def test_user_agent_new_ua(self):
        """
        Tests the old webview user agent
        """

        agent = "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 "\
                "(KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 "\
                "WgerAndroidWebApp"
        self.assertTrue(user_agents.is_android_webview(agent))
    def test_user_agent_new_ua(self):
        '''
        Tests the old webview user agent
        '''

        agent = "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 "\
                "(KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 "\
                "WgerAndroidWebApp"
        self.assertTrue(user_agents.is_android_webview(agent))