Finalized unit test
This commit is contained in:
parent
9e157ede64
commit
8e9cbdc8b9
|
@ -2,377 +2,389 @@
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('..')
|
sys.path.append('..')
|
||||||
|
|
||||||
from scrython.cards import Autocomplete, Id, Collector, Mtgo, Multiverse, Named, Random, Search, ArenaId
|
from scrython.cards import Id, Autocomplete, Search, Collector
|
||||||
import unittest
|
import unittest
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class TestCards(unittest.TestCase):
|
mtgo_card = Id(id='e3285e6b-3e79-4d7c-bf96-d920f973b122'); time.sleep(0.1)
|
||||||
|
non_online_card = Id(id='15016e8e-2f6b-4470-865a-ec13da3cb968'); time.sleep(0.1)
|
||||||
|
arena_card = Id(id='5aa75f2b-53c5-47c5-96d2-ab796358a96f'); time.sleep(0.1)
|
||||||
|
augment = Id(id='abe9fdfa-c361-465e-9639-097d441a3f74'); time.sleep(0.1)
|
||||||
|
meld = Id(id='0900e494-962d-48c6-8e78-66a489be4bb2'); time.sleep(0.1)
|
||||||
|
transform = Id(id='aae6fb12-b252-453b-bca7-1ea2a0d6c8dc'); time.sleep(0.1)
|
||||||
|
vanguard = Id(id='87c1234b-3834-4bba-bef2-05707bb1e8e2'); time.sleep(0.1)
|
||||||
|
alt_lang_card = Collector(code='ths', collector_number='75', lang='ja'); time.sleep(0.1)
|
||||||
|
planeswalker = Id(id='4c565076-5db2-47ea-8ee0-4a4fd7bb353d'); time.sleep(0.1)
|
||||||
|
|
||||||
|
class TestCardObjects(unittest.TestCase):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(TestCards, self).__init__(*args, **kwargs)
|
super(TestCardObjects, self).__init__(*args, **kwargs)
|
||||||
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')
|
|
||||||
|
|
||||||
def test_object(self):
|
def test_object(self):
|
||||||
self.assertIsInstance(self.non_online_card.object(), str)
|
self.assertIsInstance(non_online_card.object(), str)
|
||||||
self.assertEqual(self.non_online_card.object(), 'card')
|
self.assertEqual(non_online_card.object(), 'card')
|
||||||
|
|
||||||
def test_id(self):
|
def test_id(self):
|
||||||
self.assertIsInstance(self.non_online_card.id(), str)
|
self.assertIsInstance(non_online_card.id(), str)
|
||||||
self.assertEqual(self.non_online_card.id(), 'b52d516f-d425-49f1-99cc-17f743aa41b2')
|
self.assertEqual(non_online_card.id(), '15016e8e-2f6b-4470-865a-ec13da3cb968')
|
||||||
|
|
||||||
def test_multiverse_ids(self):
|
def test_multiverse_ids(self):
|
||||||
self.assertIsInstance(self.non_online_card.multiverse_ids(), list)
|
self.assertIsInstance(non_online_card.multiverse_ids(), list)
|
||||||
|
|
||||||
def test_mtgo_id(self):
|
def test_mtgo_id(self):
|
||||||
self.assertRaises(KeyError, self.non_online_card.mtgo_id)
|
self.assertRaises(KeyError, non_online_card.mtgo_id)
|
||||||
self.assertIsInstance(self.mtgo_card.mtgo_id(), int)
|
self.assertIsInstance(mtgo_card.mtgo_id(), int)
|
||||||
self.assertEqual(self.mtgo_card.mtgo_id(), 67196)
|
self.assertEqual(mtgo_card.mtgo_id(), 67196)
|
||||||
|
|
||||||
def test_mtgo_foil_id(self):
|
def test_mtgo_foil_id(self):
|
||||||
self.assertRaises(KeyError, self.non_online_card.mtgo_foil_id)
|
self.assertIsInstance(mtgo_card.mtgo_foil_id(), int)
|
||||||
self.assertIsInstance(self.mtgo_card.mtgo_foil_id(), int)
|
self.assertEqual(mtgo_card.mtgo_foil_id(), 67197)
|
||||||
self.assertEqual(self.mtgo_card.mtgo_foil_id(), 67197)
|
|
||||||
|
|
||||||
def test_name(self):
|
def test_name(self):
|
||||||
self.assertRaises(AttributeError, self.catalog.name)
|
self.assertIsInstance(non_online_card.name(), str)
|
||||||
self.assertIsInstance(self.non_online_card.name(), str)
|
self.assertEqual(non_online_card.name(), 'Magical Hack')
|
||||||
self.assertEqual(self.non_online_card.name(), 'Impulsive Return')
|
|
||||||
|
|
||||||
def test_uri(self):
|
def test_uri(self):
|
||||||
self.assertRaises(AttributeError, self.catalog.uri)
|
self.assertIsInstance(non_online_card.uri(), str)
|
||||||
self.assertIsInstance(self.non_online_card.uri(), str)
|
self.assertEqual(non_online_card.uri(), 'https://api.scryfall.com/cards/15016e8e-2f6b-4470-865a-ec13da3cb968')
|
||||||
self.assertEqual(self.non_online_card.uri(), 'https://api.scryfall.com/cards/b52d516f-d425-49f1-99cc-17f743aa41b2')
|
|
||||||
|
|
||||||
def test_scryfall_uri(self):
|
def test_scryfall_uri(self):
|
||||||
self.assertRaises(AttributeError, self.catalog.scryfall_uri)
|
self.assertIsInstance(non_online_card.scryfall_uri(), str)
|
||||||
self.assertIsInstance(self.non_online_card.scryfall_uri(), str)
|
self.assertEqual(non_online_card.scryfall_uri(), 'https://scryfall.com/card/ced/64/magical-hack?utm_source=api')
|
||||||
self.assertEqual(self.non_online_card.scryfall_uri(), 'https://scryfall.com/card/tdag/10/impulsive-return?utm_source=api')
|
|
||||||
|
|
||||||
def test_layout(self):
|
def test_layout(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.layout(), str)
|
||||||
self.assertRaises(AttributeError, self.catalog.layout)
|
self.assertEqual(non_online_card.layout(), 'normal')
|
||||||
self.assertIsInstance(self.non_online_card.layout(), str)
|
|
||||||
self.assertEqual(self.non_online_card.layout(), 'normal')
|
|
||||||
|
|
||||||
def test_highres_image(self):
|
def test_highres_image(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.highres_image(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.highres_image)
|
self.assertEqual(non_online_card.highres_image(), True)
|
||||||
self.assertIsInstance(self.non_online_card.highres_image(), )
|
|
||||||
self.assertEqual(self.non_online_card.highres_image(), )
|
|
||||||
|
|
||||||
def test_image_uris(self):
|
def test_image_uris(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.image_uris(), dict)
|
||||||
self.assertRaises(KeyError, self.catalog.image_uris)
|
self.assertEqual(non_online_card.image_uris(), {
|
||||||
self.assertIsInstance(self.non_online_card.image_uris(), )
|
"small": "https://img.scryfall.com/cards/small/en/ced/64.jpg?1517813031",
|
||||||
self.assertEqual(self.non_online_card.image_uris(), )
|
"normal": "https://img.scryfall.com/cards/normal/en/ced/64.jpg?1517813031",
|
||||||
|
"large": "https://img.scryfall.com/cards/large/en/ced/64.jpg?1517813031",
|
||||||
|
"png": "https://img.scryfall.com/cards/png/en/ced/64.png?1517813031",
|
||||||
|
"art_crop": "https://img.scryfall.com/cards/art_crop/en/ced/64.jpg?1517813031",
|
||||||
|
"border_crop": "https://img.scryfall.com/cards/border_crop/en/ced/64.jpg?1517813031"
|
||||||
|
})
|
||||||
|
|
||||||
def test_cmc(self):
|
def test_cmc(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.cmc(), float)
|
||||||
self.assertRaises(KeyError, self.catalog.cmc)
|
self.assertEqual(non_online_card.cmc(), 1.0)
|
||||||
self.assertIsInstance(self.non_online_card.cmc(), )
|
|
||||||
self.assertEqual(self.non_online_card.cmc(), )
|
|
||||||
|
|
||||||
def test_type_line(self):
|
def test_type_line(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.type_line(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.type_line)
|
self.assertEqual(non_online_card.type_line(), 'Instant')
|
||||||
self.assertIsInstance(self.non_online_card.type_line(), )
|
|
||||||
self.assertEqual(self.non_online_card.type_line(), )
|
|
||||||
|
|
||||||
def test_oracle_text(self):
|
def test_oracle_text(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.oracle_text(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.oracle_text)
|
self.assertEqual(non_online_card.oracle_text(), 'Change the text of target spell or permanent by replacing all instances of one basic land type with another. (For example, you may change \"swampwalk\" to \"plainswalk.\" This effect lasts indefinitely.)')
|
||||||
self.assertIsInstance(self.non_online_card.oracle_text(), )
|
|
||||||
self.assertEqual(self.non_online_card.oracle_text(), )
|
|
||||||
|
|
||||||
def test_mana_cost(self):
|
def test_mana_cost(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.mana_cost(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.mana_cost)
|
self.assertEqual(non_online_card.mana_cost(), '{U}')
|
||||||
self.assertIsInstance(self.non_online_card.mana_cost(), )
|
|
||||||
self.assertEqual(self.non_online_card.mana_cost(), )
|
|
||||||
|
|
||||||
def test_colors(self):
|
def test_colors(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.colors(), list)
|
||||||
self.assertRaises(KeyError, self.catalog.colors)
|
self.assertEqual(non_online_card.colors(), [
|
||||||
self.assertIsInstance(self.non_online_card.colors(), )
|
"U"
|
||||||
self.assertEqual(self.non_online_card.colors(), )
|
])
|
||||||
|
|
||||||
def test_color_identity(self):
|
def test_color_identity(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.color_identity(), list)
|
||||||
self.assertRaises(KeyError, self.catalog.color_identity)
|
self.assertEqual(non_online_card.color_identity(), [
|
||||||
self.assertIsInstance(self.non_online_card.color_identity(), )
|
"U"
|
||||||
self.assertEqual(self.non_online_card.color_identity(), )
|
])
|
||||||
|
|
||||||
def test_legalities(self):
|
def test_legalities(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.legalities(), dict)
|
||||||
self.assertRaises(KeyError, self.catalog.legalities)
|
self.assertEqual(non_online_card.legalities(), {
|
||||||
self.assertIsInstance(self.non_online_card.legalities(), )
|
"standard": "not_legal",
|
||||||
self.assertEqual(self.non_online_card.legalities(), )
|
"future": "not_legal",
|
||||||
|
"frontier": "not_legal",
|
||||||
|
"modern": "not_legal",
|
||||||
|
"legacy": "legal",
|
||||||
|
"pauper": "not_legal",
|
||||||
|
"vintage": "legal",
|
||||||
|
"penny": "not_legal",
|
||||||
|
"commander": "legal",
|
||||||
|
"1v1": "not_legal",
|
||||||
|
"duel": "legal",
|
||||||
|
"brawl": "not_legal"
|
||||||
|
})
|
||||||
|
|
||||||
def test_reserved(self):
|
def test_reserved(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.reserved(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.reserved)
|
self.assertEqual(non_online_card.reserved(), False)
|
||||||
self.assertIsInstance(self.non_online_card.reserved(), )
|
|
||||||
self.assertEqual(self.non_online_card.reserved(), )
|
|
||||||
|
|
||||||
def test_reprint(self):
|
def test_reprint(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.reprint(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.reprint)
|
self.assertEqual(non_online_card.reprint(), True)
|
||||||
self.assertIsInstance(self.non_online_card.reprint(), )
|
|
||||||
self.assertEqual(self.non_online_card.reprint(), )
|
|
||||||
|
|
||||||
def test_set_code(self):
|
def test_set_code(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.set_code(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.set_code)
|
self.assertEqual(non_online_card.set_code(), 'ced')
|
||||||
self.assertIsInstance(self.non_online_card.set_code(), )
|
|
||||||
self.assertEqual(self.non_online_card.set_code(), )
|
|
||||||
|
|
||||||
def test_set_name(self):
|
def test_set_name(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.set_name(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.set_name)
|
self.assertEqual(non_online_card.set_name(), 'Collectors\u2019 Edition')
|
||||||
self.assertIsInstance(self.non_online_card.set_name(), )
|
|
||||||
self.assertEqual(self.non_online_card.set_name(), )
|
|
||||||
|
|
||||||
def test_set_uri(self):
|
def test_set_uri(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.set_uri(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.set_uri)
|
self.assertEqual(non_online_card.set_uri(), 'https://api.scryfall.com/sets/ced')
|
||||||
self.assertIsInstance(self.non_online_card.set_uri(), )
|
|
||||||
self.assertEqual(self.non_online_card.set_uri(), )
|
|
||||||
|
|
||||||
def test_set_search_uri(self):
|
def test_set_search_uri(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.set_search_uri(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.set_search_uri)
|
self.assertEqual(non_online_card.set_search_uri(), 'https://api.scryfall.com/cards/search?order=set&q=e%3Aced&unique=prints')
|
||||||
self.assertIsInstance(self.non_online_card.set_search_uri(), )
|
|
||||||
self.assertEqual(self.non_online_card.set_search_uri(), )
|
|
||||||
|
|
||||||
def test_scryfall_set_uri(self):
|
def test_scryfall_set_uri(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.scryfall_set_uri(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.scryfall_set_uri)
|
self.assertEqual(non_online_card.scryfall_set_uri(), 'https://scryfall.com/sets/ced?utm_source=api')
|
||||||
self.assertIsInstance(self.non_online_card.scryfall_set_uri(), )
|
|
||||||
self.assertEqual(self.non_online_card.scryfall_set_uri(), )
|
|
||||||
|
|
||||||
def test_rulings_uri(self):
|
def test_rulings_uri(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.rulings_uri(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.rulings_uri)
|
self.assertEqual(non_online_card.rulings_uri(), 'https://api.scryfall.com/cards/15016e8e-2f6b-4470-865a-ec13da3cb968/rulings')
|
||||||
self.assertIsInstance(self.non_online_card.rulings_uri(), )
|
|
||||||
self.assertEqual(self.non_online_card.rulings_uri(), )
|
|
||||||
|
|
||||||
def test_prints_search_uri(self):
|
def test_prints_search_uri(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.prints_search_uri(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.prints_search_uri)
|
self.assertEqual(non_online_card.prints_search_uri(), 'https://api.scryfall.com/cards/search?order=set&q=%21%E2%80%9CMagical+Hack%E2%80%9D+include%3Aextras&unique=prints')
|
||||||
self.assertIsInstance(self.non_online_card.prints_search_uri(), )
|
|
||||||
self.assertEqual(self.non_online_card.prints_search_uri(), )
|
|
||||||
|
|
||||||
def test_collector_number(self):
|
def test_collector_number(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.collector_number(), str)
|
||||||
self.assertRaises(AttributeError, self.catalog.collector_number)
|
self.assertEqual(non_online_card.collector_number(), '64')
|
||||||
self.assertIsInstance(self.non_online_card.collector_number(), )
|
|
||||||
self.assertEqual(self.non_online_card.collector_number(), )
|
|
||||||
|
|
||||||
def test_digital(self):
|
def test_digital(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.digital(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.digital)
|
self.assertEqual(non_online_card.digital(), False)
|
||||||
self.assertIsInstance(self.non_online_card.digital(), )
|
|
||||||
self.assertEqual(self.non_online_card.digital(), )
|
|
||||||
|
|
||||||
def test_rarity(self):
|
def test_rarity(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.rarity(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.rarity)
|
self.assertEqual(non_online_card.rarity(), 'rare')
|
||||||
self.assertIsInstance(self.non_online_card.rarity(), )
|
|
||||||
self.assertEqual(self.non_online_card.rarity(), )
|
|
||||||
|
|
||||||
def test_illuStringation_id(self):
|
def test_illuStringation_id(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.illustration_id(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.illuStringation_id)
|
self.assertEqual(non_online_card.illustration_id(), 'ac51706f-d485-4d91-822f-bdf9eca67a48')
|
||||||
self.assertIsInstance(self.non_online_card.illuStringation_id(), )
|
|
||||||
self.assertEqual(self.non_online_card.illuStringation_id(), )
|
|
||||||
|
|
||||||
def test_artist(self):
|
def test_artist(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.artist(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.artist)
|
self.assertEqual(non_online_card.artist(), 'Julie Baroh')
|
||||||
self.assertIsInstance(self.non_online_card.artist(), )
|
|
||||||
self.assertEqual(self.non_online_card.artist(), )
|
|
||||||
|
|
||||||
def test_frame(self):
|
def test_frame(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.frame(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.frame)
|
self.assertEqual(non_online_card.frame(), '1993')
|
||||||
self.assertIsInstance(self.non_online_card.frame(), )
|
|
||||||
self.assertEqual(self.non_online_card.frame(), )
|
|
||||||
|
|
||||||
def test_full_art(self):
|
def test_full_art(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.full_art(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.full_art)
|
self.assertEqual(non_online_card.full_art(), False)
|
||||||
self.assertIsInstance(self.non_online_card.full_art(), )
|
|
||||||
self.assertEqual(self.non_online_card.full_art(), )
|
|
||||||
|
|
||||||
def test_border_color(self):
|
def test_border_color(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.border_color(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.border_color)
|
self.assertEqual(non_online_card.border_color(), 'black')
|
||||||
self.assertIsInstance(self.non_online_card.border_color(), )
|
|
||||||
self.assertEqual(self.non_online_card.border_color(), )
|
|
||||||
|
|
||||||
def test_timeshifted(self):
|
def test_timeshifted(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.timeshifted(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.timeshifted)
|
self.assertEqual(non_online_card.timeshifted(), False)
|
||||||
self.assertIsInstance(self.non_online_card.timeshifted(), )
|
|
||||||
self.assertEqual(self.non_online_card.timeshifted(), )
|
|
||||||
|
|
||||||
def test_colorshifted(self):
|
def test_colorshifted(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.colorshifted(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.colorshifted)
|
self.assertEqual(non_online_card.colorshifted(), False)
|
||||||
self.assertIsInstance(self.non_online_card.colorshifted(), )
|
|
||||||
self.assertEqual(self.non_online_card.colorshifted(), )
|
|
||||||
|
|
||||||
def test_futureshifted(self):
|
def test_futureshifted(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.futureshifted(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.futureshifted)
|
self.assertEqual(non_online_card.futureshifted(), False)
|
||||||
self.assertIsInstance(self.non_online_card.futureshifted(), )
|
|
||||||
self.assertEqual(self.non_online_card.futureshifted(), )
|
|
||||||
|
|
||||||
def test_edhrec_rank(self):
|
def test_edhrec_rank(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.edhrec_rank(), int)
|
||||||
self.assertRaises(KeyError, self.catalog.edhrec_rank)
|
self.assertEqual(non_online_card.edhrec_rank(), 15314)
|
||||||
self.assertIsInstance(self.non_online_card.edhrec_rank(), )
|
|
||||||
self.assertEqual(self.non_online_card.edhrec_rank(), )
|
|
||||||
|
|
||||||
def test_currency(self):
|
def test_currency(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.currency('eur'), str)
|
||||||
self.assertRaises(KeyError, self.catalog.currency)
|
|
||||||
self.assertIsInstance(self.non_online_card.currency(), )
|
|
||||||
self.assertEqual(self.non_online_card.currency(), )
|
|
||||||
|
|
||||||
def test_related_uris(self):
|
def test_related_uris(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.related_uris(), dict)
|
||||||
self.assertRaises(KeyError, self.catalog.related_uris)
|
self.assertEqual(non_online_card.related_uris(), {
|
||||||
self.assertIsInstance(self.non_online_card.related_uris(), )
|
"tcgplayer_decks": "http://decks.tcgplayer.com/magic/deck/search?contains=Magical+Hack&page=1&partner=Scryfall",
|
||||||
self.assertEqual(self.non_online_card.related_uris(), )
|
"edhrec": "http://edhrec.com/route/?cc=Magical+Hack",
|
||||||
|
"mtgtop8": "http://mtgtop8.com/search?MD_check=1&SB_check=1&cards=Magical+Hack"
|
||||||
|
})
|
||||||
|
|
||||||
def test_purchase_uris(self):
|
def test_purchase_uris(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.purchase_uris(), dict)
|
||||||
self.assertRaises(KeyError, self.catalog.purchase_uris)
|
self.assertEqual(non_online_card.purchase_uris(), {
|
||||||
self.assertIsInstance(self.non_online_card.purchase_uris(), )
|
"amazon": "https://www.amazon.com/gp/search?ie=UTF8&index=toys-and-games&keywords=Magical+Hack&tag=scryfall-20",
|
||||||
self.assertEqual(self.non_online_card.purchase_uris(), )
|
"ebay": "http://rover.ebay.com/rover/1/711-53200-19255-0/1?campid=5337966903&icep_catId=19107&icep_ff3=10&icep_sortBy=12&icep_uq=Magical+Hack&icep_vectorid=229466&ipn=psmain&kw=lg&kwid=902099&mtid=824&pub=5575230669&toolid=10001",
|
||||||
|
"tcgplayer": "https://scryfall.com/s/tcgplayer/97547",
|
||||||
|
"magiccardmarket": "https://scryfall.com/s/mcm/17013",
|
||||||
|
"cardhoarder": "https://www.cardhoarder.com/cards?affiliate_id=scryfall&data%5Bsearch%5D=Magical+Hack&ref=card-profile&utm_campaign=affiliate&utm_medium=card&utm_source=scryfall",
|
||||||
|
"card_kingdom": "https://www.cardkingdom.com/catalog/search?filter%5Bname%5D=Magical+Hack&partner=scryfall&utm_campaign=affiliate&utm_medium=scryfall&utm_source=scryfall",
|
||||||
|
"mtgo_traders": "http://www.mtgotraders.com/store/search.php?q=Magical+Hack&referral=scryfall",
|
||||||
|
"coolstuffinc": "https://scryfall.com/s/coolstuffinc/1677222"
|
||||||
|
})
|
||||||
|
|
||||||
def test_life_modifier(self):
|
def test_life_modifier(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(vanguard.life_modifier(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.life_modifier)
|
self.assertEqual(vanguard.life_modifier(), '+18')
|
||||||
self.assertIsInstance(self.non_online_card.life_modifier(), )
|
|
||||||
self.assertEqual(self.non_online_card.life_modifier(), )
|
|
||||||
|
|
||||||
def test_hand_modifier(self):
|
def test_hand_modifier(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(vanguard.hand_modifier(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.hand_modifier)
|
self.assertEqual(vanguard.hand_modifier(), '-2')
|
||||||
self.assertIsInstance(self.non_online_card.hand_modifier(), )
|
|
||||||
self.assertEqual(self.non_online_card.hand_modifier(), )
|
|
||||||
|
|
||||||
def test_color_indicator(self):
|
def test_color_indicator(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(transform.color_indicator(1), list)
|
||||||
self.assertRaises(KeyError, self.catalog.color_indicator)
|
self.assertEqual(transform.color_indicator(1), [
|
||||||
self.assertIsInstance(self.non_online_card.color_indicator(), )
|
"G",
|
||||||
self.assertEqual(self.non_online_card.color_indicator(), )
|
"R"
|
||||||
|
])
|
||||||
|
|
||||||
def test_all_parts(self):
|
def test_all_parts(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(transform.all_parts(), list)
|
||||||
self.assertRaises(KeyError, self.catalog.all_parts)
|
self.assertEqual(transform.all_parts(), [
|
||||||
self.assertIsInstance(self.non_online_card.all_parts(), )
|
{
|
||||||
self.assertEqual(self.non_online_card.all_parts(), )
|
"object": "related_card",
|
||||||
|
"id": "aae6fb12-b252-453b-bca7-1ea2a0d6c8dc",
|
||||||
|
"name": "Huntmaster of the Fells // Ravager of the Fells",
|
||||||
|
"uri": "https://api.scryfall.com/cards/dka/140"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object": "related_card",
|
||||||
|
"id": "a53f8031-aaa8-424c-929a-5478538a8cc6",
|
||||||
|
"name": "Wolf",
|
||||||
|
"uri": "https://api.scryfall.com/cards/tisd/12"
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
def non_online_card_faces(self):
|
def non_online_card_faces(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(transform.card_faces(), list)
|
||||||
self.assertRaises(KeyError, self.catalog.card_faces)
|
self.assertEqual(transform.card_faces(), [
|
||||||
self.assertIsInstance(self.non_online_card.card_faces(), )
|
{
|
||||||
self.assertEqual(self.non_online_card.card_faces(), )
|
"object": "card_face",
|
||||||
|
"name": "Huntmaster of the Fells",
|
||||||
|
"mana_cost": "{2}{R}{G}",
|
||||||
|
"type_line": "Creature \u2014 Human Werewolf",
|
||||||
|
"oracle_text": "Whenever this creature enters the battlefield or transforms into Huntmaster of the Fells, create a 2/2 green Wolf creature token and you gain 2 life.\nAt the beginning of each upkeep, if no spells were cast last turn, transform Huntmaster of the Fells.",
|
||||||
|
"colors": [
|
||||||
|
"G",
|
||||||
|
"R"
|
||||||
|
],
|
||||||
|
"power": "2",
|
||||||
|
"toughness": "2",
|
||||||
|
"artist": "Chris Rahn",
|
||||||
|
"illustration_id": "8ce1bfa2-7cd6-4f4f-b23e-c5d985acec48",
|
||||||
|
"image_uris": {
|
||||||
|
"small": "https://img.scryfall.com/cards/small/en/dka/140a.jpg?1518205189",
|
||||||
|
"normal": "https://img.scryfall.com/cards/normal/en/dka/140a.jpg?1518205189",
|
||||||
|
"large": "https://img.scryfall.com/cards/large/en/dka/140a.jpg?1518205189",
|
||||||
|
"png": "https://img.scryfall.com/cards/png/en/dka/140a.png?1518205189",
|
||||||
|
"art_crop": "https://img.scryfall.com/cards/art_crop/en/dka/140a.jpg?1518205189",
|
||||||
|
"border_crop": "https://img.scryfall.com/cards/border_crop/en/dka/140a.jpg?1518205189"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object": "card_face",
|
||||||
|
"name": "Ravager of the Fells",
|
||||||
|
"mana_cost": "",
|
||||||
|
"type_line": "Creature \u2014 Werewolf",
|
||||||
|
"oracle_text": "Trample\nWhenever this creature transforms into Ravager of the Fells, it deals 2 damage to target opponent or planeswalker and 2 damage to up to one target creature that player or that planeswalker's controller controls.\nAt the beginning of each upkeep, if a player cast two or more spells last turn, transform Ravager of the Fells.",
|
||||||
|
"colors": [
|
||||||
|
"G",
|
||||||
|
"R"
|
||||||
|
],
|
||||||
|
"color_indicator": [
|
||||||
|
"G",
|
||||||
|
"R"
|
||||||
|
],
|
||||||
|
"power": "4",
|
||||||
|
"toughness": "4",
|
||||||
|
"artist": "Chris Rahn",
|
||||||
|
"illustration_id": "a26de848-cc6a-4f49-9d43-72afa3c80b3e",
|
||||||
|
"image_uris": {
|
||||||
|
"small": "https://img.scryfall.com/cards/small/en/dka/140b.jpg?1518205189",
|
||||||
|
"normal": "https://img.scryfall.com/cards/normal/en/dka/140b.jpg?1518205189",
|
||||||
|
"large": "https://img.scryfall.com/cards/large/en/dka/140b.jpg?1518205189",
|
||||||
|
"png": "https://img.scryfall.com/cards/png/en/dka/140b.png?1518205189",
|
||||||
|
"art_crop": "https://img.scryfall.com/cards/art_crop/en/dka/140b.jpg?1518205189",
|
||||||
|
"border_crop": "https://img.scryfall.com/cards/border_crop/en/dka/140b.jpg?1518205189"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
def test_watermark(self):
|
def test_watermark(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(mtgo_card.watermark(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.watermark)
|
self.assertEqual(mtgo_card.watermark(), 'set')
|
||||||
self.assertIsInstance(self.non_online_card.watermark(), )
|
|
||||||
self.assertEqual(self.non_online_card.watermark(), )
|
|
||||||
|
|
||||||
def test_story_spotlight(self):
|
def test_story_spotlight(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.story_spotlight(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.story_spotlight)
|
self.assertEqual(non_online_card.story_spotlight(), False)
|
||||||
self.assertIsInstance(self.non_online_card.story_spotlight(), )
|
|
||||||
self.assertEqual(self.non_online_card.story_spotlight(), )
|
|
||||||
|
|
||||||
def test_power(self):
|
def test_power(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(augment.power(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.power)
|
self.assertEqual(augment.power(), '+4')
|
||||||
self.assertIsInstance(self.non_online_card.power(), )
|
|
||||||
self.assertEqual(self.non_online_card.power(), )
|
|
||||||
|
|
||||||
def test_toughness(self):
|
def test_toughness(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(augment.toughness(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.toughness)
|
self.assertEqual(augment.toughness(), '+4')
|
||||||
self.assertIsInstance(self.non_online_card.toughness(), )
|
|
||||||
self.assertEqual(self.non_online_card.toughness(), )
|
|
||||||
|
|
||||||
def test_flavor_text(self):
|
def test_flavor_text(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(meld.flavor_text(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.flavor_text)
|
self.assertEqual(meld.flavor_text(), "\"We're ready for anything!\"")
|
||||||
self.assertIsInstance(self.non_online_card.flavor_text(), )
|
|
||||||
self.assertEqual(self.non_online_card.flavor_text(), )
|
|
||||||
|
|
||||||
def test_arena_id(self):
|
def test_arena_id(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(arena_card.arena_id(), int)
|
||||||
self.assertRaises(KeyError, self.catalog.arena_id)
|
self.assertEqual(arena_card.arena_id(), 66975)
|
||||||
self.assertIsInstance(self.non_online_card.arena_id(), )
|
|
||||||
self.assertEqual(self.non_online_card.arena_id(), )
|
|
||||||
|
|
||||||
def test_lang(self):
|
def test_lang(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.lang(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.lang)
|
self.assertEqual(non_online_card.lang(), 'en')
|
||||||
self.assertIsInstance(self.non_online_card.lang(), )
|
|
||||||
self.assertEqual(self.non_online_card.lang(), )
|
|
||||||
|
|
||||||
def test_printed_name(self):
|
def test_printed_name(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(alt_lang_card.printed_name(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.printed_name)
|
self.assertEqual(alt_lang_card.printed_name(), '忌まわしき首領')
|
||||||
self.assertIsInstance(self.non_online_card.printed_name(), )
|
|
||||||
self.assertEqual(self.non_online_card.printed_name(), )
|
|
||||||
|
|
||||||
def test_printed_type_line(self):
|
def test_printed_type_line(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(alt_lang_card.printed_type_line(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.printed_type_line)
|
self.assertEqual(alt_lang_card.printed_type_line(), 'クリーチャー — デーモン')
|
||||||
self.assertIsInstance(self.non_online_card.printed_type_line(), )
|
|
||||||
self.assertEqual(self.non_online_card.printed_type_line(), )
|
|
||||||
|
|
||||||
def test_printed_text(self):
|
def test_printed_text(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(alt_lang_card.printed_text(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.printed_text)
|
self.assertEqual(alt_lang_card.printed_text(), '飛行\n忌まわしき首領が戦場に出たとき、飛行を持つ黒の1/1のハーピー・クリーチャー・トークンをあなたの黒への信心に等しい数だけ戦場に出す。(あなたの黒への信心は、あなたがコントロールするパーマネントのマナ・コストに含まれる{B}の総数に等しい。)\nあなたのアップキープの開始時に、クリーチャーを1体生け贄に捧げる。')
|
||||||
self.assertIsInstance(self.non_online_card.printed_text(), )
|
|
||||||
self.assertEqual(self.non_online_card.printed_text(), )
|
|
||||||
|
|
||||||
def test_oracle_id(self):
|
def test_oracle_id(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.oracle_id(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.oracle_id)
|
self.assertEqual(non_online_card.oracle_id(), 'cba229fa-9035-405b-b091-3798898a37ee')
|
||||||
self.assertIsInstance(self.non_online_card.oracle_id(), )
|
|
||||||
self.assertEqual(self.non_online_card.oracle_id(), )
|
|
||||||
|
|
||||||
def test_foil(self):
|
def test_foil(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.foil(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.foil)
|
self.assertEqual(non_online_card.foil(), False)
|
||||||
self.assertIsInstance(self.non_online_card.foil(), )
|
|
||||||
self.assertEqual(self.non_online_card.foil(), )
|
|
||||||
|
|
||||||
def test_loyalty(self):
|
def test_loyalty(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(planeswalker.loyalty(), str)
|
||||||
self.assertRaises(KeyError, self.catalog.loyalty)
|
self.assertEqual(planeswalker.loyalty(), '4')
|
||||||
self.assertIsInstance(self.non_online_card.loyalty(), )
|
|
||||||
self.assertEqual(self.non_online_card.loyalty(), )
|
|
||||||
|
|
||||||
def test_non_foil(self):
|
def test_non_foil(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.nonfoil(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.non_foil)
|
self.assertEqual(non_online_card.nonfoil(), True)
|
||||||
self.assertIsInstance(self.non_online_card.non_foil(), )
|
|
||||||
self.assertEqual(self.non_online_card.non_foil(), )
|
|
||||||
|
|
||||||
def test_oversized(self):
|
def test_oversized(self):
|
||||||
self.skipTest('Test not set up.')
|
self.assertIsInstance(non_online_card.oversized(), bool)
|
||||||
self.assertRaises(KeyError, self.catalog.oversized)
|
self.assertEqual(non_online_card.oversized(), False)
|
||||||
self.assertIsInstance(self.non_online_card.oversized(), )
|
|
||||||
self.assertEqual(self.non_online_card.oversized(), )
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
test_classes_to_run = [
|
||||||
|
TestCardObjects
|
||||||
|
]
|
||||||
|
|
||||||
|
loader = unittest.TestLoader()
|
||||||
|
|
||||||
|
suites_list = []
|
||||||
|
for test_class in test_classes_to_run:
|
||||||
|
suite = loader.loadTestsFromTestCase(test_class)
|
||||||
|
suites_list.append(suite)
|
||||||
|
|
||||||
|
big_suite = unittest.TestSuite(suites_list)
|
||||||
|
|
||||||
|
runner = unittest.TextTestRunner()
|
||||||
|
results = runner.run(big_suite)
|
||||||
|
|
Loading…
Reference in New Issue