コード例 #1
0
def extract_our_flavors(avail_flavors, product, version, partial_updates, product_key=None):
    if not product_key:
        product_key = product

    if is_rc(product_key, version, partial_updates):
        product_key = f"{product_key}_rc"

    if product_key not in SUPPORTED_FLAVORS:
        raise UnsupportedFlavor(description=f"`{product_key}` is not supported")

    # sanity check
    all_flavors = set([fl["name"] for fl in SUPPORTED_FLAVORS[product_key]])
    if not set(avail_flavors).issuperset(all_flavors):
        description = f"Some flavors are not in actions.json: {all_flavors.difference(set(avail_flavors))}."
        raise UnsupportedFlavor(description=description)
    return SUPPORTED_FLAVORS[product_key]
コード例 #2
0
def test_is_rc(product, version, partial_updates, result):
    assert is_rc(product, version, partial_updates) == result