Ejemplo n.º 1
0
def test_expand_alternatives_1(blank_resource_db):
    db = blank_resource_db
    a = RequirementSet.impossible()
    b = make_single_set(make_req_a(db))
    expected = make_single_set(make_req_a(db))

    assert a.expand_alternatives(b) == expected
Ejemplo n.º 2
0
def test_trivial_merge(blank_game_description):
    db = blank_game_description.resource_database
    res_a, id_req_a = make_req_a(db)
    trivial = RequirementSet.trivial()
    impossible = RequirementSet.impossible()

    the_set = RequirementSet([
        RequirementList([id_req_a]),
    ])

    assert trivial.union(trivial) == trivial
    assert trivial.union(the_set) == the_set
    assert the_set.union(trivial) == the_set
    assert trivial.union(impossible) == impossible
    assert impossible.union(the_set) == impossible
    assert the_set.union(impossible) == impossible
    assert the_set.union(the_set) == the_set
Ejemplo n.º 3
0
def test_set_as_str_impossible():
    assert RequirementSet.impossible().as_str == "Impossible"
Ejemplo n.º 4
0
def test_impossible_requirement_as_set():
    assert Requirement.impossible().as_set(None) == RequirementSet.impossible()
Ejemplo n.º 5
0
def test_expand_alternatives_2():
    a = RequirementSet.impossible()
    b = RequirementSet.trivial()
    expected = RequirementSet.trivial()

    assert a.expand_alternatives(b) == expected