Решение на BiDict от Никола Собаджиев
Обратно към всички решения
Към профила на Никола Собаджиев
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 9 успешни тест(а)
- 7 неуспешни тест(а)
Код
Лог от изпълнението
.EEEE...F.F...E.
======================================================================
ERROR: test_assign_value_and_reverse (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 18, in test_assign_value_and_reverse
self.assertEqual(self.person['Кънчов'], 'last_name')
KeyError: 'Кънчов'
======================================================================
ERROR: test_circular_values (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 49, in test_circular_values
circular = self.solutions.BiDict({1: 2, 2: 3, 3: 1})
AttributeError: 'BiDictTestCase' object has no attribute 'solutions'
======================================================================
ERROR: test_copied_circular_values (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 57, in test_copied_circular_values
inversed_circular.inverse()
AttributeError: 'dict' object has no attribute 'inverse'
======================================================================
ERROR: test_double_inverse (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 23, in test_double_inverse
self.assertEqual(self.person['name'], 'Кънчо')
KeyError: 'name'
======================================================================
ERROR: test_lots_of_even_inverses (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 32, in test_lots_of_even_inverses
self.assertEqual(self.person['name'], 'Кънчо')
KeyError: 'name'
======================================================================
FAIL: test_insert_existing_key_with_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 78, in test_insert_existing_key_with_existing_value
self.assertNotIn('age', new_person.keys())
AssertionError: 'age' unexpectedly found in dict_keys(['age', 'name', 'sex'])
======================================================================
FAIL: test_insert_none_existing_key_with_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9hd46a", line 92, in test_insert_none_existing_key_with_existing_value
self.assertNotIn('age', new_person.keys())
AssertionError: 'age' unexpectedly found in dict_keys(['age', 'name', 'none', 'sex'])
----------------------------------------------------------------------
Ran 16 tests in 0.004s
FAILED (failures=2, errors=5)
История (1 версия и 2 коментара)
Никола обнови решението на 14.04.2012 13:00 (преди над 12 години)