test_https-everywhere.py 787 Bytes
Newer Older
1
2
3
from marionette_driver import By
from marionette_driver.errors import MarionetteException

4
from marionette_harness import MarionetteTestCase
5
6
7
8

import testsuite


9
class Test(MarionetteTestCase):
10
11

    def setUp(self):
12
        MarionetteTestCase.setUp(self)
13
14
15
16

        ts = testsuite.TestSuite()
        self.ts = ts

17
18
        self.HTTP_URL = "http://httpbin.org/"
        self.HTTPS_URL = "https://httpbin.org/"
19
20
21
22
23
24
25
26
27
28
29


    def test_https_everywhere(self):
        with self.marionette.using_context('content'):
            self.marionette.navigate(self.HTTP_URL)

            if self.ts.t['test']['name'] == 'https-everywhere':
                self.assertEqual(self.marionette.get_url(), self.HTTPS_URL)
            else:
                self.assertEqual(self.marionette.get_url(), self.HTTP_URL)