From 310f104734c72cad3b73901d5bf0ee7cef067e3a Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 12 May 2020 20:55:14 +0200 Subject: Add unit tests for swifstory.cards Signed-off-by: Olivier Gayot --- tests/test_cards.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_cards.py (limited to 'tests') diff --git a/tests/test_cards.py b/tests/test_cards.py new file mode 100644 index 0000000..019d512 --- /dev/null +++ b/tests/test_cards.py @@ -0,0 +1,27 @@ +import unittest + +from swiftstory.Cards import Cards + + +class TestCards(unittest.TestCase): + def test_get_cards_fr(self): + self.assertTrue(Cards.get_white_cards("fr")) + self.assertTrue(Cards.get_black_cards("fr")) + + def test_get_cards_en(self): + self.assertTrue(Cards.get_white_cards("en")) + self.assertTrue(Cards.get_black_cards("en")) + + def test_get_cards_unknown_language(self): + try: + Cards.get_white_cards("zz") + except FileNotFoundError: + pass + else: + self.fail("Found zz white cards.") + try: + Cards.get_black_cards("zz") + except FileNotFoundError: + pass + else: + self.fail("Found zz black cards.") -- cgit v1.2.3