Example #1
0
class TestWar(unittest.TestCase):
    """ Submodule for unittests, derives from unittest.TestCase """
    def setUp(self):
        """ Create object for all tests """
        self.testgame = War()

    def tearDown(self):
        """ Remove dependencies after test """
        self.testgame = None

    def test_conv_str(self):
        """ Test staticmethod. conv_str. Should return integer"""
        self.assertIsInstance(self.testgame.conv_str('knight'), int)

    def test_if_card_in_hand(self):
        """ Test method. card in hand. Should return bool val false """
        self.testgame.player1.cards = []
        self.testgame.player2.cards = []
        self.assertFalse(self.testgame.if_card_in_hand())