Решение на BiDict от Николай Колев
Обратно към всички решения
Към профила на Николай Колев
Резултати
- 3 точки от тестове
- 0 бонус точки
- 3 точки общо
- 7 успешни тест(а)
- 9 неуспешни тест(а)
Код
Лог от изпълнението
..EE..FEEEEEE...
======================================================================
ERROR: test_circular_values (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", 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-9bzlmv", line 56, in test_copied_circular_values
inversed_circular = circular.copy()
AttributeError: 'BiDict' object has no attribute 'copy'
======================================================================
ERROR: test_hashing_self (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 65, in test_hashing_self
self.assertRaises(TypeError, self.person.update, {'clone': self.person})
AttributeError: 'BiDict' object has no attribute 'update'
======================================================================
ERROR: test_insert_existing_key_with_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 74, in test_insert_existing_key_with_existing_value
new_person = self.person.copy()
AttributeError: 'BiDict' object has no attribute 'copy'
======================================================================
ERROR: test_insert_existing_key_with_none_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 81, in test_insert_existing_key_with_none_existing_value
new_person = self.person.copy()
AttributeError: 'BiDict' object has no attribute 'copy'
======================================================================
ERROR: test_insert_none_existing_key_with_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 88, in test_insert_none_existing_key_with_existing_value
new_person = self.person.copy()
AttributeError: 'BiDict' object has no attribute 'copy'
======================================================================
ERROR: test_insert_none_existing_key_with_none_existing_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 95, in test_insert_none_existing_key_with_none_existing_value
new_person = self.person.copy()
AttributeError: 'BiDict' object has no attribute 'copy'
======================================================================
ERROR: test_invalid_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 62, in test_invalid_value
self.assertRaises(TypeError, self.person.update, {'sports': ['boxing',]})
AttributeError: 'BiDict' object has no attribute 'update'
======================================================================
FAIL: test_has_dict_attrs (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-9bzlmv", line 70, in test_has_dict_attrs
self.assertIn('copy', dir(self.person))
AssertionError: 'copy' not found in ['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'clear', 'dictionary', 'inverse', 'items', 'keys', 'pop', 'values']
----------------------------------------------------------------------
Ran 16 tests in 0.003s
FAILED (failures=1, errors=8)
История (1 версия и 0 коментара)
Николай обнови решението на 10.04.2012 22:00 (преди над 12 години)