Решение на Тесте карти от Стефан Владков
Обратно към всички решения
Към профила на Стефан Владков
Резултати
- 1 точка от тестове
- 0 бонус точки
- 1 точка общо
- 1 успешни тест(а)
- 15 неуспешни тест(а)
Код
Лог от изпълнението
<class 'solution.Ace'>
<class 'solution.Spades'>
Ace of Spades
EEEEEEEEFFFFFFF.
======================================================================
ERROR: test_belote_deck (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 174, in test_belote_deck
cards = [str(card) for card in solution.BeloteDeck()]
AttributeError: 'module' object has no attribute 'BeloteDeck'
======================================================================
ERROR: test_deck_add (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 117, in test_deck_add
deck = solution.CardCollection()
TypeError: __init__() missing 1 required positional argument: 'collection'
======================================================================
ERROR: test_deck_draw (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 142, in test_deck_draw
self.assertEqual(len(deck), 51)
TypeError: object of type 'CardCollection' has no len()
======================================================================
ERROR: test_deck_index (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 154, in test_deck_index
deck = solution.CardCollection()
TypeError: __init__() missing 1 required positional argument: 'collection'
======================================================================
ERROR: test_deck_iteration (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 166, in test_deck_iteration
for card in deck:
TypeError: 'CardCollection' object is not iterable
======================================================================
ERROR: test_deck_order (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 129, in test_deck_order
deck = solution.CardCollection()
TypeError: __init__() missing 1 required positional argument: 'collection'
======================================================================
ERROR: test_sixtysix_deck (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 178, in test_sixtysix_deck
cards = [str(card) for card in solution.SixtySixDeck()]
AttributeError: 'module' object has no attribute 'SixtySixDeck'
======================================================================
ERROR: test_standard_deck (test.CardCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 170, in test_standard_deck
cards = [str(card) for card in solution.StandardDeck()]
AttributeError: 'module' object has no attribute 'StandardDeck'
======================================================================
FAIL: test_all_card_instances (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 67, in test_all_card_instances
self.assertIsInstance(card.rank, rank)
AssertionError: <class 'solution.Queen'> is not an instance of <class 'solution.Queen'>
======================================================================
FAIL: test_all_cards_equal (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 81, in test_all_cards_equal
self.assertEqual(card1, card2)
AssertionError: <solution.Card object at 0xb7814bac> != <solution.Card object at 0xb7814bec>
======================================================================
FAIL: test_all_suits_ranks_equal (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 92, in test_all_suits_ranks_equal
self.assertEqual(card.rank, rank())
AssertionError: <class 'solution.Queen'> != <solution.Queen object at 0xb7814fcc>
======================================================================
FAIL: test_all_to_string (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 104, in test_all_to_string
+ " of " + str(card.suit))
AssertionError: 'Queen of Diamonds' != "<class 'solution.Queen'> of <class 'solution.Diamonds'>"
- Queen of Diamonds
+ <class 'solution.Queen'> of <class 'solution.Diamonds'>
======================================================================
FAIL: test_card_equals (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 73, in test_card_equals
self.assertEqual(aos1, aos2)
AssertionError: <solution.Card object at 0xb78189cc> != <solution.Card object at 0xb7818a0c>
======================================================================
FAIL: test_card_instance (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 60, in test_card_instance
self.assertIsInstance(aos.rank, solution.RANKS["Ace"])
AssertionError: <class 'solution.Ace'> is not an instance of <class 'solution.Ace'>
======================================================================
FAIL: test_suit_rank_equals (test.CardTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140407-19315-ecr0tg/test.py", line 85, in test_suit_rank_equals
self.assertEqual(aos.rank, solution.RANKS["Ace"]())
AssertionError: <class 'solution.Ace'> != <solution.Ace object at 0xb782508c>
----------------------------------------------------------------------
Ran 16 tests in 0.018s
FAILED (failures=7, errors=8)
История (1 версия и 0 коментара)
Стефан обнови решението на 26.03.2014 16:54 (преди над 10 години)