def test_load_one(): lines = [ "N:Contact Specialist", "T:2:1:1", "E@0:2@1:1", "P:3:EXTRA_MILITARY:-1:0", "P:3:PAY_MILITARY:1:0", ] res = load_one(lines) assert "Contact Specialist" == res.name assert TYPE_DEVELOPMENT == res.type
def test_load_one_with_flags(): lines = [ "N:Gateway Station", "T:1:0:0", "E@0:1", "#E:1:1:1:1:1", "G:ANY", "F:PROMO", ] res = load_one(lines) assert res.flags is not None assert TYPE_WORLD == res.type assert "PROMO" in res.flags
def test_gambling_world(): lines = [ "N:Gambling World", "T:1:1:1", "E@0:1@2:-1", "P:4:CONSUME_ANY | GET_VP:1:1", "P:4:DRAW_LUCKY:0:0", ] res = load_one(lines) assert TYPE_WORLD == res.type assert len(res.expansion) == 2 assert "0" in res.expansion assert res.expansion["0"] == 1 assert "2" in res.expansion assert res.expansion["2"] == -1
def test_load_one_with_produce(): lines = [ "N:New Vinland", "T:1:2:1", "E@0:1", "G:NOVELTY", "P:4:CONSUME_ANY | GET_2_CARD:1:1", "P:5:PRODUCE:0:0", ] res = load_one(lines) assert TYPE_WORLD == res.type assert len(res.powers) == 2 assert GOODTYPE_NOVELTY == res.goodtype assert "5" in res.powers assert len(res.powers["5"]) == 1
def test_load_one_with_extra_victory(): lines = [ "N:Pan-Galactic League", "T:2:6:0", "E@0:1", "P:3:EXTRA_MILITARY:-1:0", "P:5:DRAW_WORLD_GENE:1:0", "V:2:GENE_PRODUCTION:N/A", "V:2:GENE_WINDFALL:N/A", "V:1:MILITARY:N/A", "V:3:NAME:Contact Specialist", ] res = load_one(lines) assert TYPE_DEVELOPMENT == res.type assert len(res.extra_victory) > 0