From 460e13009a04d7a9539d285b67b503d3a4570ee3 Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Mon, 22 Oct 2018 13:52:23 -0400 Subject: [PATCH] Created a unittest folder for Scrython --- unittests/TestCards.py | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 unittests/TestCards.py diff --git a/unittests/TestCards.py b/unittests/TestCards.py new file mode 100644 index 0000000..86eade4 --- /dev/null +++ b/unittests/TestCards.py @@ -0,0 +1,45 @@ +# 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) + self.autocomplete = Autocomplete(q='Thal') + time.sleep(0.1) + self.by_scryfall_id = Id(id='e3285e6b-3e79-4d7c-bf96-d920f973b122') + time.sleep(0.1) + self.collector = Collector(code='v10', collector_number='1') + time.sleep(0.1) + self.mtgo = Mtgo(id='66811') + time.sleep(0.1) + self.multiverse = Multiverse(id='212630') + time.sleep(0.1) + self.named = Named(fuzzy='Lightning Bolt') + time.sleep(0.1) + self.random = Random() + time.sleep(0.1) + self.search = Search(q='f:commander') + time.sleep(0.1) + self.by_arena_id = ArenaId(id='66975') + time.sleep(0.1) + + def test_object(self): + self.assertIsInstance(self.autocomplete.object(), str) + self.assertIsInstance(self.by_scryfall_id.object(), str) + self.assertIsInstance(self.collector.object(), str) + self.assertIsInstance(self.mtgo.object(), str) + self.assertIsInstance(self.multiverse.object(), str) + self.assertIsInstance(self.named.object(), str) + self.assertIsInstance(self.random.object(), str) + self.assertIsInstance(self.search.object(), str) + self.assertIsInstance(self.by_arena_id.object(), str) + self.assertIsInstance(self.named.object(), str) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file