Esempio n. 1
0
    def test_build_tpmanifest(self, tmpdir):
        manifest_file = tmpdir.join('file.manifest').ensure(file=True)
        test_instance = mock_test(url='test_page.html',
                                  tpmanifest=str(manifest_file))

        test_dict = get_test(self.config, self.global_overrides, [], test_instance)
        assert test_dict['tpmanifest'].endswith('.develop')
Esempio n. 2
0
    def test_build_tpmanifest(self, tmpdir):
        manifest_file = tmpdir.join('file.manifest').ensure(file=True)
        test_instance = mock_test(url='test_page.html',
                                  tpmanifest=str(manifest_file))

        test_dict = get_test(self.config, self.global_overrides, [], test_instance)
        assert test_dict['tpmanifest'].endswith('.develop')
Esempio n. 3
0
    def test_build_tpmanifest(self, tmpdir):
        manifest_file = tmpdir.join("file.manifest").ensure(file=True)
        test_instance = mock_test(url="test_page.html",
                                  tpmanifest=str(manifest_file))

        test_dict = get_test(self.config, self.global_overrides, [],
                             test_instance)
        assert test_dict["tpmanifest"].endswith(".develop")
Esempio n. 4
0
    def test_doesnt_override_specific_keys_unless_they_are_null(self):
        test_instance = mock_test()
        test_dict = get_test({}, self.global_overrides, [], test_instance)

        assert test_dict['tpmozafterpaint'] == 'value'
        assert test_dict['firstpaint'] == 'value'
        assert test_dict['userready'] == 'value'
        assert test_dict['fnbpaint'] == 'value'

        # nulls still get overriden
        test_instance = mock_test(
            tpmozafterpaint=None, firstpaint=None, userready=None, fnbpaint=None)
        test_dict = get_test({}, self.global_overrides, [], test_instance)

        assert test_dict['tpmozafterpaint'] == 'overriden'
        assert test_dict['firstpaint'] == 'overriden'
        assert test_dict['userready'] == 'overriden'
        assert test_dict['fnbpaint'] == 'overriden'
Esempio n. 5
0
    def test_doesnt_override_specific_keys_unless_they_are_null(self):
        test_instance = mock_test()
        test_dict = get_test({}, self.global_overrides, [], test_instance)

        assert test_dict['tpmozafterpaint'] == 'value'
        assert test_dict['firstpaint'] == 'value'
        assert test_dict['userready'] == 'value'
        assert test_dict['fnbpaint'] == 'value'

        # nulls still get overriden
        test_instance = mock_test(
            tpmozafterpaint=None, firstpaint=None, userready=None, fnbpaint=None)
        test_dict = get_test({}, self.global_overrides, [], test_instance)

        assert test_dict['tpmozafterpaint'] == 'overriden'
        assert test_dict['firstpaint'] == 'overriden'
        assert test_dict['userready'] == 'overriden'
        assert test_dict['fnbpaint'] == 'overriden'
Esempio n. 6
0
    def test_interpolate_keys(self, mock_open):
        mock_open.return_value = mock.MagicMock(readlines=lambda: [])

        test_instance = mock_test(url='${talos}/test_page.html',
                                  tpmanifest='${talos}/file.manifest')

        test_dict = get_test(self.config, self.global_overrides, [], test_instance)
        assert test_dict['url'].startswith('http://test_webserver/')
        assert '${talos}' not in test_dict['url']
        assert '${talos}' not in test_dict['tpmanifest']
Esempio n. 7
0
    def test_interpolate_keys(self, mock_open):
        mock_open.return_value = mock.MagicMock(readlines=lambda: [])

        test_instance = mock_test(url='${talos}/test_page.html',
                                  tpmanifest='${talos}/file.manifest')

        test_dict = get_test(self.config, self.global_overrides, [], test_instance)
        assert test_dict['url'].startswith('http://test_webserver/')
        assert '${talos}' not in test_dict['url']
        assert '${talos}' not in test_dict['tpmanifest']
Esempio n. 8
0
    def test_interpolate_keys(self, mock_open):
        mock_open.return_value = mock.MagicMock(readlines=lambda: [])

        test_instance = mock_test(url="${talos}/test_page.html",
                                  tpmanifest="${talos}/file.manifest")

        test_dict = get_test(self.config, self.global_overrides, [],
                             test_instance)
        assert test_dict["url"].startswith("http://test_webserver/")
        assert "${talos}" not in test_dict["url"]
        assert "${talos}" not in test_dict["tpmanifest"]
Esempio n. 9
0
    def test_doesnt_override_specific_keys_unless_they_are_null(self):
        test_instance = mock_test()
        test_dict = get_test({}, self.global_overrides, [], test_instance)

        assert test_dict["tpmozafterpaint"] == "value"
        assert test_dict["firstpaint"] == "value"
        assert test_dict["userready"] == "value"
        assert test_dict["fnbpaint"] == "value"

        # nulls still get overriden
        test_instance = mock_test(tpmozafterpaint=None,
                                  firstpaint=None,
                                  userready=None,
                                  fnbpaint=None)
        test_dict = get_test({}, self.global_overrides, [], test_instance)

        assert test_dict["tpmozafterpaint"] == "overriden"
        assert test_dict["firstpaint"] == "overriden"
        assert test_dict["userready"] == "overriden"
        assert test_dict["fnbpaint"] == "overriden"
Esempio n. 10
0
    def test_add_counters(self):
        test_instance = mock_test(
            linux_counters=None,
            mac_counters=[],
            win_counters=['counter_a'],
            w7_counters=['counter_a', 'counter_b'],
            xperf_counters=['counter_a', 'counter_extra'])

        counters = ['counter_a', 'counter_b', 'counter_c']
        test_dict = get_test(self.config, self.global_overrides, counters,
                             test_instance)

        assert test_dict['linux_counters'] == counters
        assert test_dict['mac_counters'] == counters
        assert test_dict['win_counters'] == counters
        assert test_dict['w7_counters'] == counters
        assert set(test_dict['xperf_counters']) == set(counters +
                                                       ['counter_extra'])
Esempio n. 11
0
    def test_add_counters(self):
        test_instance = mock_test(
            linux_counters=None,
            mac_counters=[],
            win_counters=['counter_a'],
            w7_counters=['counter_a', 'counter_b'],
            xperf_counters=['counter_a', 'counter_extra']
        )

        counters = ['counter_a', 'counter_b', 'counter_c']
        test_dict = get_test(
            self.config, self.global_overrides, counters, test_instance)

        assert test_dict['linux_counters'] == counters
        assert test_dict['mac_counters'] == counters
        assert test_dict['win_counters'] == counters
        assert test_dict['w7_counters'] == counters
        assert set(test_dict['xperf_counters']) == set(counters + ['counter_extra'])
Esempio n. 12
0
    def test_add_counters(self):
        test_instance = mock_test(
            linux_counters=None,
            mac_counters=[],
            win_counters=["counter_a"],
            w7_counters=["counter_a", "counter_b"],
            xperf_counters=["counter_a", "counter_extra"],
        )

        counters = ["counter_a", "counter_b", "counter_c"]
        test_dict = get_test(self.config, self.global_overrides, counters,
                             test_instance)

        assert test_dict["linux_counters"] == counters
        assert test_dict["mac_counters"] == counters
        assert test_dict["win_counters"] == counters
        assert test_dict["w7_counters"] == counters
        assert set(test_dict["xperf_counters"]) == set(counters +
                                                       ["counter_extra"])