def test_checking_function_if_there_is_tierce_in_the_cards_should_return_list_of_tierces( self): team1 = Team('Malinka', (Person('Ivan'), Person('Gosho'))) team1.teammates[0].cards = [ Card('9', 'D'), Card('Q', 'D'), Card('K', 'D'), Card('Q', 'C'), Card('8', 'D'), Card('J', 'D'), Card('Q', 'S'), Card('A', 'H'), Card('7', 'D'), Card('J', 'H'), Card('8', 'C') ] sorted_list = Utls.sort_cards(team1.teammates[0].cards) tierce_list = Utls.check_if_there_is_tierce(sorted_list) self.assertEqual(tierce_list, [['Tierce', 'D', '9'], ['Tierce', 'D', '13']])
def test_validating_names_are_string_not_integer(self): exception = None try: person = Team(123, (Person('Ivan'), Person('Gosho'))) person1 = Team('name', (Person(123), Person('Gosho'))) person1 = Team('name', (Person('Ivan'), Person(123))) except Exception as err: exception = err self.assertIsNotNone(exception) self.assertEqual(str(exception), 'Name must be string')