Решение на BiDict от Рая Димитрова
Обратно към всички решения
Към профила на Рая Димитрова
Резултати
- 2 точки от тестове
- 0 бонус точки
- 2 точки общо
- 5 успешни тест(а)
- 11 неуспешни тест(а)
Код
Лог от изпълнението
EEEEEE.F....FFEE
======================================================================
ERROR: test_assign_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 13, in test_assign_value
self.assertEqual(self.person['last_name'], 'Кънчов')
KeyError: 'last_name'
======================================================================
ERROR: test_assign_value_and_reverse (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", 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-cy4yjy", 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-cy4yjy", 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-cy4yjy", line 23, in test_double_inverse
self.assertEqual(self.person['name'], 'Кънчо')
KeyError: 'name'
======================================================================
ERROR: test_get_a_key (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 9, in test_get_a_key
self.assertEqual(self.person['name'], 'Кънчо')
KeyError: 'name'
======================================================================
ERROR: test_lots_of_even_inverses (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 32, in test_lots_of_even_inverses
self.assertEqual(self.person['name'], 'Кънчо')
KeyError: 'name'
======================================================================
ERROR: test_lots_of_odd_inverses (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 42, in test_lots_of_odd_inverses
self.assertEqual(self.person['Кънчо'], 'name')
KeyError: 'Кънчо'
======================================================================
FAIL: test_hashing_self (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 65, in test_hashing_self
self.assertRaises(TypeError, self.person.update, {'clone': self.person})
AssertionError: TypeError not raised by update
======================================================================
FAIL: test_invalid_value (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 62, in test_invalid_value
self.assertRaises(TypeError, self.person.update, {'sports': ['boxing',]})
AssertionError: TypeError not raised by update
======================================================================
FAIL: test_inverse (__main__.BiDictTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test20120627-22085-cy4yjy", line 46, in test_inverse
self.assertIn('Кънчо', self.person.keys())
AssertionError: 'Кънчо' not found in dict_keys([])
----------------------------------------------------------------------
Ran 16 tests in 0.003s
FAILED (failures=3, errors=8)
История (1 версия и 1 коментар)
Рая обнови решението на 18.04.2012 04:17 (преди над 12 години)