def test_task_in_context(self):
        # match
        tag_set_list, task_tags = [
            load_json_fixture(f)
            for f in ("matchingTagSetList.json", "matchingTaskTags.json")
        ]
        assert TaskclusterModelImpl._task_in_context(tag_set_list,
                                                     task_tags) is True

        # mismatch
        tag_set_list, task_tags = [
            load_json_fixture(f)
            for f in ("mismatchingTagSetList.json", "mismatchingTaskTags.json")
        ]
        assert TaskclusterModelImpl._task_in_context(tag_set_list,
                                                     task_tags) is False
Beispiel #2
0
 def test_can_instantiate_without_credentials(self):
     try:
         _ = TaskclusterModelImpl(self.FAKE_ROOT_URL)
     except ValueError:
         pytest.fail(
             "Should be able to instantiate TaskclusterModelImpl without providing credentials."
         )
 def test_can_still_instantiate_when_testing(self):
     try:
         _ = TaskclusterModelImpl(
             *self.FAKE_OPTIONS,
             unit_testing_this=True,
         )
     except RuntimeError:
         pytest.fail(
             "We should be able to instantiate TaskclusterModelImpl when testing"
         )
    def test_get_action(self, actions_json, expected_backfill_task):
        action_array = actions_json["actions"]

        backfill_task = TaskclusterModelImpl._get_action(
            action_array, "backfill")
        assert backfill_task == expected_backfill_task
    def test_filter_relevant_actions(self, actions_json, original_task,
                                     expected_actions_json):
        reduced_actions_json = TaskclusterModelImpl._filter_relevant_actions(
            actions_json, original_task)

        assert reduced_actions_json == expected_actions_json
 def test_cannot_instantiate_on_production(self):
     with pytest.raises(RuntimeError):
         _ = TaskclusterModelImpl(*self.FAKE_OPTIONS)