Решение на Регулярни изрази от Димитър Трендафилов
Обратно към всички решения
Към профила на Димитър Трендафилов
Резултати
- 8 точки от тестове
- 0 бонус точки
- 8 точки общо
- 31 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
....F..........FF.....FF..FFF..........
======================================================================
FAIL: test_does_not_filter_invalid_phone_numbers (test.PrivacyFilterTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 86, in test_does_not_filter_invalid_phone_numbers
self.assertEqual(filtered, solution.PrivacyFilter(text).filtered())
AssertionError: 'Reach me at: 0885123' != 'Reach me at: [PHONE]'
- Reach me at: 0885123
+ Reach me at: [PHONE]
======================================================================
FAIL: test_can_validate_more_complex_emails (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 124, in test_can_validate_more_complex_emails
self.assertIs(solution.Validations.is_email(email), valid)
AssertionError: None is not False
======================================================================
FAIL: test_can_validate_more_complex_phone_numbers (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 160, in test_can_validate_more_complex_phone_numbers
self.assertIs(solution.Validations.is_phone(phone), valid)
AssertionError: <_sre.SRE_Match object at 0xb77818b8> is not False
======================================================================
FAIL: test_handles_multiline_strings_in_IP_validation_properly (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 189, in test_handles_multiline_strings_in_IP_validation_properly
self.assertFalse(solution.Validations.is_ip_address("8.8.8.8\n"))
AssertionError: <_sre.SRE_Match object at 0xb7825d90> is not false
======================================================================
FAIL: test_handles_multiline_strings_in_hostname_validation_properly (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 179, in test_handles_multiline_strings_in_hostname_validation_properly
self.assertFalse(solution.Validations.is_hostname("foo.com\n"))
AssertionError: <_sre.SRE_Match object at 0xb7785260> is not false
======================================================================
FAIL: test_handles_newlines_in_date_validation (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 259, in test_handles_newlines_in_date_validation
self.assertFalse(solution.Validations.is_date("2012-11-19\n"))
AssertionError: <_sre.SRE_Match object at 0xb7827a88> is not false
======================================================================
FAIL: test_handles_newlines_in_time_and_datetime_validation (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 288, in test_handles_newlines_in_time_and_datetime_validation
self.assertFalse(solution.Validations.is_time("12:01:01\n"))
AssertionError: <_sre.SRE_Match object at 0xb7825ed0> is not false
======================================================================
FAIL: test_returns_boolean_True_or_False (test.ValidationsTest)
----------------------------------------------------------------------
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/d20140513-11348-o616fe/test.py", line 109, in test_returns_boolean_True_or_False
self.assertIs(solution.Validations.is_email('foo@bar.com'), True)
AssertionError: <_sre.SRE_Match object at 0xb77852c0> is not True
----------------------------------------------------------------------
Ran 39 tests in 0.045s
FAILED (failures=8)
История (5 версии и 2 коментара)
Димитър обнови решението на 21.04.2014 01:22 (преди над 10 години)
Димитър обнови решението на 21.04.2014 03:32 (преди над 10 години)
Димитър обнови решението на 22.04.2014 23:06 (преди над 10 години)
Димитър обнови решението на 23.04.2014 12:07 (преди над 10 години)
Димитър обнови решението на 23.04.2014 15:38 (преди над 10 години)