Решение на Четири функции от Георги Горанов
Обратно към всички решения
Към профила на Георги Горанов
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 14 успешни тест(а)
- 6 неуспешни тест(а)
Код
Лог от изпълнението
...E.......FFF.FE...
======================================================================
ERROR: test_cache_no_cache (test.SecondHomeworkTests)
----------------------------------------------------------------------
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/d20130408-29081-l6aolt/test.py", line 104, in test_cache_no_cache
self.assertEqual(42 * 2, cached_double(42))
File "/tmp/d20130408-29081-l6aolt/solution.py", line 47, in controller
cache_dict.popitem(last=False)
File "/opt/python3.3/lib/python3.3/collections/__init__.py", line 114, in popitem
raise KeyError('dictionary is empty')
KeyError: 'dictionary is empty'
======================================================================
ERROR: test_zip_with_infinite_sequence (test.SecondHomeworkTests)
----------------------------------------------------------------------
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/d20130408-29081-l6aolt/test.py", line 82, in test_zip_with_infinite_sequence
self.assertEqual(expected, list(actual))
File "/tmp/d20130408-29081-l6aolt/solution.py", line 30, in zip_with
if len(iterable) < length:
TypeError: object of type 'itertools.repeat' has no len()
======================================================================
FAIL: test_iterate_out_of_order_calls (test.SecondHomeworkTests)
----------------------------------------------------------------------
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/d20130408-29081-l6aolt/test.py", line 53, in test_iterate_out_of_order_calls
self.assertEqual(1 * 'eggs', f0('eggs'))
AssertionError: 'eggs' != 'eggseggseggseggseggseggseggseggs'
- eggs
+ eggseggseggseggseggseggseggseggs
======================================================================
FAIL: test_iterate_out_of_order_calls_again (test.SecondHomeworkTests)
----------------------------------------------------------------------
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/d20130408-29081-l6aolt/test.py", line 53, in test_iterate_out_of_order_calls
self.assertEqual(1 * 'eggs', f0('eggs'))
AssertionError: 'eggs' != 'eggseggseggseggseggseggseggseggs'
- eggs
+ eggseggseggseggseggseggseggseggs
======================================================================
FAIL: test_iterate_out_of_order_calls_yet_again (test.SecondHomeworkTests)
----------------------------------------------------------------------
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/d20130408-29081-l6aolt/test.py", line 53, in test_iterate_out_of_order_calls
self.assertEqual(1 * 'eggs', f0('eggs'))
AssertionError: 'eggs' != 'eggseggseggseggseggseggseggseggs'
- eggs
+ eggseggseggseggseggseggseggseggs
======================================================================
FAIL: test_zip_with_empty (test.SecondHomeworkTests)
----------------------------------------------------------------------
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/d20130408-29081-l6aolt/test.py", line 67, in test_zip_with_empty
self.assertEqual(expected, list(actual))
AssertionError: Lists differ: [] != [None]
Second list contains 1 additional elements.
First extra element 0:
None
- []
+ [None]
----------------------------------------------------------------------
Ran 20 tests in 0.015s
FAILED (failures=4, errors=2)
История (1 версия и 0 коментара)
Георги обнови решението на 15.03.2013 22:27 (преди над 11 години)