aboutsummaryrefslogtreecommitdiffstats
path: root/test_sorin.py
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2015-05-31 13:29:32 +0200
committerEduardo Pedroni <ep625@york.ac.uk>2015-05-31 13:29:32 +0200
commit46609b49b4b1e32ce058bf29d458563451d58259 (patch)
tree2501a7b639da3b2e985dbe73e21e34a55051bc52 /test_sorin.py
parentff6fddd6958d8c8e16ee6d575a992ef616ef57d9 (diff)
Added tests for a few more cards, trying different test script with travis
Diffstat (limited to 'test_sorin.py')
-rwxr-xr-xtest_sorin.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/test_sorin.py b/test_sorin.py
index 5ae732b..05192f8 100755
--- a/test_sorin.py
+++ b/test_sorin.py
@@ -10,7 +10,7 @@ class Test_cardInformationParsing(unittest.TestCase):
@classmethod
def setUpClass(cls):
- with open("sorin", "r") as file:
+ with open("testcards/sorin", "r") as file:
cls.page = html.fromstring(file.read())
# Tests
@@ -50,6 +50,22 @@ class Test_cardInformationParsing(unittest.TestCase):
def test_correctLoyaltyIsParsed(self):
self.assertEqual(cardbase.getLoyalty(self.page), "4")
+class Test_additionalCardData(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.card = cardbase.fetchCard("m12", "109")
+
+ def test_cardHasCorrectEdition(self):
+ self.assertEqual(self.card.edition, "m12")
+
+ def test_cardHasCorrectScan(self):
+ self.assertEqual(self.card.scan, "http://magiccards.info/scans/en/m12/109.jpg")
+
+ def test_cardHasCorrectNumber(self):
+ self.assertEqual(self.card.number, "109")
+
+
def test():
unittest.main(exit=False)