# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json import unittest from pprint import pprint from unittest.mock import patch
import pytest from mozunit import MockedOpen, main from taskgraph import create from taskgraph.util import taskcluster
from gecko_taskgraph import actions from gecko_taskgraph.actions.util import combine_task_graph_files, relativize_datestamps from gecko_taskgraph.decision import read_artifact
TASK_DEF = { "created": "2017-10-10T18:33:03.460Z", # note that this is not an even number of seconds off! "deadline": "2017-10-11T18:33:03.461Z", "dependencies": [], "expires": "2018-10-10T18:33:04.461Z", "payload": { "artifacts": { "public": { "expires": "2018-10-10T18:33:03.463Z", "path": "/builds/worker/artifacts", "type": "directory",
},
}, "maxRunTime": 1800,
},
}
class TestCombineTaskGraphFiles(unittest.TestCase): def test_no_suffixes(self): with MockedOpen({}):
combine_task_graph_files([])
self.assertRaises(Exception, open("artifacts/to-run.json"))
def is_subset(subset, superset): if isinstance(subset, dict): return all(
key in superset and is_subset(val, superset[key]) for key, val in subset.items()
)
if isinstance(subset, list) or isinstance(subset, set): return all(
any(is_subset(subitem, superitem) for superitem in superset) for subitem in subset
)
if isinstance(subset, str): return subset in superset
# assume that subset is a plain value if none of the above match return subset == superset
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.