Scrython/unittests/TestCards.py

379 lines
16 KiB
Python
Raw Normal View History

2018-10-22 17:52:23 +00:00
# This workaround makes sure that we can import from the parent dir
import sys
sys.path.append('..')
from scrython.cards import Autocomplete, Id, Collector, Mtgo, Multiverse, Named, Random, Search, ArenaId
import unittest
import time
class TestCards(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestCards, self).__init__(*args, **kwargs)
2018-10-22 20:40:41 +00:00
self.non_online_card = Id(id='b52d516f-d425-49f1-99cc-17f743aa41b2')
self.mtgo_card = Id(id='e3285e6b-3e79-4d7c-bf96-d920f973b122')
self.catalog = Autocomplete(q='Thal')
2018-10-22 17:52:23 +00:00
def test_object(self):
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.object(), str)
self.assertEqual(self.non_online_card.object(), 'card')
def test_id(self):
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.id(), str)
self.assertEqual(self.non_online_card.id(), 'b52d516f-d425-49f1-99cc-17f743aa41b2')
def test_multiverse_ids(self):
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.multiverse_ids(), list)
def test_mtgo_id(self):
2018-10-22 20:40:41 +00:00
self.assertRaises(KeyError, self.non_online_card.mtgo_id)
self.assertIsInstance(self.mtgo_card.mtgo_id(), int)
self.assertEqual(self.mtgo_card.mtgo_id(), 67196)
def test_mtgo_foil_id(self):
2018-10-22 20:40:41 +00:00
self.assertRaises(KeyError, self.non_online_card.mtgo_foil_id)
self.assertIsInstance(self.mtgo_card.mtgo_foil_id(), int)
self.assertEqual(self.mtgo_card.mtgo_foil_id(), 67197)
def test_name(self):
2018-10-22 20:40:41 +00:00
self.assertRaises(AttributeError, self.catalog.name)
self.assertIsInstance(self.non_online_card.name(), str)
self.assertEqual(self.non_online_card.name(), 'Impulsive Return')
def test_uri(self):
2018-10-22 20:40:41 +00:00
self.assertRaises(AttributeError, self.catalog.uri)
self.assertIsInstance(self.non_online_card.uri(), str)
self.assertEqual(self.non_online_card.uri(), 'https://api.scryfall.com/cards/b52d516f-d425-49f1-99cc-17f743aa41b2')
def test_scryfall_uri(self):
2018-10-22 20:40:41 +00:00
self.assertRaises(AttributeError, self.catalog.scryfall_uri)
self.assertIsInstance(self.non_online_card.scryfall_uri(), str)
self.assertEqual(self.non_online_card.scryfall_uri(), 'https://scryfall.com/card/tdag/10/impulsive-return?utm_source=api')
def test_layout(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(AttributeError, self.catalog.layout)
self.assertIsInstance(self.non_online_card.layout(), str)
self.assertEqual(self.non_online_card.layout(), 'normal')
def test_highres_image(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.highres_image)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.highres_image(), )
self.assertEqual(self.non_online_card.highres_image(), )
def test_image_uris(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.image_uris)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.image_uris(), )
self.assertEqual(self.non_online_card.image_uris(), )
def test_cmc(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.cmc)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.cmc(), )
self.assertEqual(self.non_online_card.cmc(), )
def test_type_line(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.type_line)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.type_line(), )
self.assertEqual(self.non_online_card.type_line(), )
def test_oracle_text(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.oracle_text)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.oracle_text(), )
self.assertEqual(self.non_online_card.oracle_text(), )
def test_mana_cost(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.mana_cost)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.mana_cost(), )
self.assertEqual(self.non_online_card.mana_cost(), )
def test_colors(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.colors)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.colors(), )
self.assertEqual(self.non_online_card.colors(), )
def test_color_identity(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.color_identity)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.color_identity(), )
self.assertEqual(self.non_online_card.color_identity(), )
def test_legalities(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.legalities)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.legalities(), )
self.assertEqual(self.non_online_card.legalities(), )
def test_reserved(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.reserved)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.reserved(), )
self.assertEqual(self.non_online_card.reserved(), )
def test_reprint(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.reprint)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.reprint(), )
self.assertEqual(self.non_online_card.reprint(), )
def test_set_code(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.set_code)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.set_code(), )
self.assertEqual(self.non_online_card.set_code(), )
def test_set_name(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.set_name)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.set_name(), )
self.assertEqual(self.non_online_card.set_name(), )
def test_set_uri(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.set_uri)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.set_uri(), )
self.assertEqual(self.non_online_card.set_uri(), )
def test_set_search_uri(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.set_search_uri)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.set_search_uri(), )
self.assertEqual(self.non_online_card.set_search_uri(), )
def test_scryfall_set_uri(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.scryfall_set_uri)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.scryfall_set_uri(), )
self.assertEqual(self.non_online_card.scryfall_set_uri(), )
def test_rulings_uri(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.rulings_uri)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.rulings_uri(), )
self.assertEqual(self.non_online_card.rulings_uri(), )
def test_prints_search_uri(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.prints_search_uri)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.prints_search_uri(), )
self.assertEqual(self.non_online_card.prints_search_uri(), )
def test_collector_number(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(AttributeError, self.catalog.collector_number)
self.assertIsInstance(self.non_online_card.collector_number(), )
self.assertEqual(self.non_online_card.collector_number(), )
def test_digital(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.digital)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.digital(), )
self.assertEqual(self.non_online_card.digital(), )
def test_rarity(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.rarity)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.rarity(), )
self.assertEqual(self.non_online_card.rarity(), )
def test_illuStringation_id(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.illuStringation_id)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.illuStringation_id(), )
self.assertEqual(self.non_online_card.illuStringation_id(), )
def test_artist(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.artist)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.artist(), )
self.assertEqual(self.non_online_card.artist(), )
def test_frame(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.frame)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.frame(), )
self.assertEqual(self.non_online_card.frame(), )
def test_full_art(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.full_art)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.full_art(), )
self.assertEqual(self.non_online_card.full_art(), )
def test_border_color(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.border_color)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.border_color(), )
self.assertEqual(self.non_online_card.border_color(), )
def test_timeshifted(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.timeshifted)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.timeshifted(), )
self.assertEqual(self.non_online_card.timeshifted(), )
def test_colorshifted(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.colorshifted)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.colorshifted(), )
self.assertEqual(self.non_online_card.colorshifted(), )
def test_futureshifted(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.futureshifted)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.futureshifted(), )
self.assertEqual(self.non_online_card.futureshifted(), )
def test_edhrec_rank(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.edhrec_rank)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.edhrec_rank(), )
self.assertEqual(self.non_online_card.edhrec_rank(), )
def test_currency(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.currency)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.currency(), )
self.assertEqual(self.non_online_card.currency(), )
def test_related_uris(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.related_uris)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.related_uris(), )
self.assertEqual(self.non_online_card.related_uris(), )
def test_purchase_uris(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.purchase_uris)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.purchase_uris(), )
self.assertEqual(self.non_online_card.purchase_uris(), )
def test_life_modifier(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.life_modifier)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.life_modifier(), )
self.assertEqual(self.non_online_card.life_modifier(), )
def test_hand_modifier(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.hand_modifier)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.hand_modifier(), )
self.assertEqual(self.non_online_card.hand_modifier(), )
def test_color_indicator(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.color_indicator)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.color_indicator(), )
self.assertEqual(self.non_online_card.color_indicator(), )
def test_all_parts(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.all_parts)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.all_parts(), )
self.assertEqual(self.non_online_card.all_parts(), )
2018-10-22 20:40:41 +00:00
def non_online_card_faces(self):
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.card_faces)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.card_faces(), )
self.assertEqual(self.non_online_card.card_faces(), )
def test_watermark(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.watermark)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.watermark(), )
self.assertEqual(self.non_online_card.watermark(), )
def test_story_spotlight(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.story_spotlight)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.story_spotlight(), )
self.assertEqual(self.non_online_card.story_spotlight(), )
def test_power(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.power)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.power(), )
self.assertEqual(self.non_online_card.power(), )
def test_toughness(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.toughness)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.toughness(), )
self.assertEqual(self.non_online_card.toughness(), )
def test_flavor_text(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.flavor_text)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.flavor_text(), )
self.assertEqual(self.non_online_card.flavor_text(), )
def test_arena_id(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.arena_id)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.arena_id(), )
self.assertEqual(self.non_online_card.arena_id(), )
def test_lang(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.lang)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.lang(), )
self.assertEqual(self.non_online_card.lang(), )
def test_printed_name(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.printed_name)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.printed_name(), )
self.assertEqual(self.non_online_card.printed_name(), )
def test_printed_type_line(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.printed_type_line)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.printed_type_line(), )
self.assertEqual(self.non_online_card.printed_type_line(), )
def test_printed_text(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.printed_text)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.printed_text(), )
self.assertEqual(self.non_online_card.printed_text(), )
def test_oracle_id(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.oracle_id)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.oracle_id(), )
self.assertEqual(self.non_online_card.oracle_id(), )
def test_foil(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.foil)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.foil(), )
self.assertEqual(self.non_online_card.foil(), )
def test_loyalty(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.loyalty)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.loyalty(), )
self.assertEqual(self.non_online_card.loyalty(), )
def test_non_foil(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.non_foil)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.non_foil(), )
self.assertEqual(self.non_online_card.non_foil(), )
def test_oversized(self):
2018-10-22 20:40:41 +00:00
self.skipTest('Test not set up.')
self.assertRaises(KeyError, self.catalog.oversized)
2018-10-22 20:40:41 +00:00
self.assertIsInstance(self.non_online_card.oversized(), )
self.assertEqual(self.non_online_card.oversized(), )
2018-10-22 17:52:23 +00:00
if __name__ == '__main__':
2018-10-22 20:40:41 +00:00
unittest.main()