def test_making_defined_cards(): for card_name in card_prototypes.keys(): card = Card(card_name)
def test_referencing_properties(): for card_name in card_prototypes.keys(): card = Card(card_name) assert(type(card._properties).__name__ == 'card_prototype_data')
assert(type(card._properties).__name__ == 'card_prototype_data') def test_card_equality(): assert(Card('gold') == Card('gold')) assert(Card('gold') != Card('copper')) def test_card_has_name(): assert(Card('gold').has_name('gold')) assert(not Card('gold').has_name('copper')) ################ Usage Examples ########### if __name__ == "__main__": card = Card('copper') print card._properties.is_treasure for card_name in card_prototypes.keys(): card = Card(card_name) if card.is_treasure(): print card_name + " is a treasure card costing " + str(card._properties.purchase_cost) if card.is_action(): print card_name + " is an action card costing " + str(card._properties.purchase_cost) if card.is_victory(): print card_name + " is a victory card costing " + str(card._properties.purchase_cost) if card.is_curse(): print card_name + " is a curse card costing " + str(card._properties.purchase_cost)