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')
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")
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'
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']
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"]
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"
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'])
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'])
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"])