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
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
def test_set_as_str_impossible(): assert RequirementSet.impossible().as_str == "Impossible"
def test_impossible_requirement_as_set(): assert Requirement.impossible().as_set(None) == RequirementSet.impossible()
def test_expand_alternatives_2(): a = RequirementSet.impossible() b = RequirementSet.trivial() expected = RequirementSet.trivial() assert a.expand_alternatives(b) == expected