Решение на Тесте карти от Людмила Савова
Обратно към всички решения
Към профила на Людмила Савова
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 5 успешни тест(а)
- 11 неуспешни тест(а)
Код
Лог от изпълнението
FE.E.EFFF.FF.FF.
======================================================================
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-15t5azv/test.py", line 121, in test_deck_add
self.assertEqual(deck[0], card1)
File "/opt/python3.3/lib/python3.3/unittest/case.py", line 642, in assertEqual
assertion_func(first, second, msg=msg)
File "/opt/python3.3/lib/python3.3/unittest/case.py", line 632, in _baseAssertEqual
if not first == second:
File "/tmp/d20140407-19315-15t5azv/solution.py", line 43, in __eq__
return self.rank == other.rank and self.suit == other.suit
AttributeError: 'str' object has no attribute 'rank'
======================================================================
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-15t5azv/test.py", line 160, in test_deck_index
self.assertEqual(0, deck.index(card1))
File "/tmp/d20140407-19315-15t5azv/solution.py", line 81, in index
first_found = next(obj for obj in self.collection if obj == card)
File "/tmp/d20140407-19315-15t5azv/solution.py", line 81, in <genexpr>
first_found = next(obj for obj in self.collection if obj == card)
File "/tmp/d20140407-19315-15t5azv/solution.py", line 43, in __eq__
return self.rank == other.rank and self.suit == other.suit
AttributeError: 'str' object has no attribute 'rank'
======================================================================
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-15t5azv/test.py", line 134, in test_deck_order
self.assertEqual(deck.bottom_card(), card1)
File "/opt/python3.3/lib/python3.3/unittest/case.py", line 642, in assertEqual
assertion_func(first, second, msg=msg)
File "/opt/python3.3/lib/python3.3/unittest/case.py", line 632, in _baseAssertEqual
if not first == second:
File "/tmp/d20140407-19315-15t5azv/solution.py", line 43, in __eq__
return self.rank == other.rank and self.suit == other.suit
AttributeError: 'str' object has no attribute 'rank'
======================================================================
FAIL: 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-15t5azv/test.py", line 175, in test_belote_deck
self.assertEqual(BELOTE_DECK, cards)
AssertionError: Lists differ: ['King of Diamonds', 'Queen of... != ['King of Diamonds', 'King of ...
First differing element 1:
Queen of Diamonds
King of Spades
Diff is 1277 characters long. Set self.maxDiff to None to see it.
======================================================================
FAIL: 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-15t5azv/test.py", line 179, in test_sixtysix_deck
self.assertEqual(SIXTY_SIX_DECK, cards)
AssertionError: Lists differ: ['King of Diamonds', 'Queen of... != ['King of Diamonds', 'King of ...
First differing element 1:
Queen of Diamonds
King of Spades
Second list contains 38 additional elements.
First extra element 24:
Nine of Diamonds
Diff is 1669 characters long. Set self.maxDiff to None to see it.
======================================================================
FAIL: 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-15t5azv/test.py", line 171, in test_standard_deck
self.assertEqual(STANDARD_DECK, cards)
AssertionError: Lists differ: ['King of Diamonds', 'Queen of... != ['King of Diamonds', 'King of ...
First differing element 1:
Queen of Diamonds
King of Spades
Second list contains 62 additional elements.
First extra element 52:
Ten of Hearts
Diff is 3361 characters long. Set self.maxDiff to None to see it.
======================================================================
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-15t5azv/test.py", line 67, in test_all_card_instances
self.assertIsInstance(card.rank, rank)
AssertionError: <class 'solution.Four'> is not an instance of <class 'solution.Four'>
======================================================================
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-15t5azv/test.py", line 92, in test_all_suits_ranks_equal
self.assertEqual(card.rank, rank())
AssertionError: <class 'solution.Four'> != <solution.Four object at 0xb6d51f6c>
======================================================================
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-15t5azv/test.py", line 104, in test_all_to_string
+ " of " + str(card.suit))
AssertionError: 'Four of Diamonds' != "<class 'solution.Four'> of <class 'solution.Diamonds'>"
- Four of Diamonds
+ <class 'solution.Four'> of <class 'solution.Diamonds'>
======================================================================
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-15t5azv/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-15t5azv/test.py", line 85, in test_suit_rank_equals
self.assertEqual(aos.rank, solution.RANKS["Ace"]())
AssertionError: <class 'solution.Ace'> != <solution.Ace object at 0xb6d599ac>
----------------------------------------------------------------------
Ran 16 tests in 0.050s
FAILED (failures=8, errors=3)
История (3 версии и 3 коментара)
Людмила обнови решението на 22.03.2014 21:56 (преди над 10 години)
Людмила обнови решението на 24.03.2014 12:06 (преди над 10 години)
Людмила обнови решението на 25.03.2014 20:50 (преди над 10 години)