Решение на BiDict от Илия Идакиев
Обратно към всички решения
Към профила на Илия Идакиев
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 8 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
EEEE..FFF.F.....
======================================================================
ERROR: test_assign_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-1jjttti", line 12, in test_assign_value
self.person['last_name'] = 'Кънчов'
TypeError: 'BiDict' object does not support item assignment
======================================================================
ERROR: test_assign_value_and_reverse (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-1jjttti", line 16, in test_assign_value_and_reverse
self.person['last_name'] = 'Кънчов'
TypeError: 'BiDict' object does not support item assignment
======================================================================
ERROR: test_circular_values (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-1jjttti", 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-1jjttti", line 57, in test_copied_circular_values
inversed_circular.inverse()
AttributeError: 'dict' object has no attribute 'inverse'
======================================================================
FAIL: test_has_dict_attrs (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-1jjttti", line 71, in test_has_dict_attrs
self.assertIn('items', dir(self.person))
AssertionError: 'items' not found in ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'clear', 'copy', 'fromkeys', 'get', 'information', 'inverse', 'keys', 'pop', 'setdefault', 'update', 'values']
======================================================================
FAIL: test_hashing_self (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-1jjttti", line 65, in test_hashing_self
self.assertRaises(TypeError, self.person.update, {'clone': self.person})
AssertionError: TypeError not raised by update
======================================================================
FAIL: test_insert_existing_key_with_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-1jjttti", 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-1jjttti", 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.003s
FAILED (failures=4, errors=4)
История (1 версия и 0 коментара)
Илия обнови решението на 11.04.2012 21:05 (преди над 12 години)