Решение на Регулярни изрази от Георги Антонов
Обратно към всички решения
Към профила на Георги Антонов
Резултати
- 8 точки от тестове
- 0 бонус точки
- 8 точки общо
- 31 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
...FF..F........F.....FF..FF...........
======================================================================
FAIL: test_does_not_filter_invalid_emails (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-1451j9j/test.py", line 48, in test_does_not_filter_invalid_emails
self.assertEqual(text, solution.PrivacyFilter(text).filtered())
AssertionError: 'And more: someone@invalid.domaintld' != 'And more: [EMAIL]aintld'
- And more: someone@invalid.domaintld
+ And more: [EMAIL]aintld
======================================================================
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-1451j9j/test.py", line 86, in test_does_not_filter_invalid_phone_numbers
self.assertEqual(filtered, solution.PrivacyFilter(text).filtered())
AssertionError: '0005551234569' != '00[PHONE]'
- 0005551234569
+ 00[PHONE]
======================================================================
FAIL: test_obfuscates_more_complicated_emails (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-1451j9j/test.py", line 37, in test_obfuscates_more_complicated_emails
self.assertEqual(filtered, solution.PrivacyFilter(text).filtered())
AssertionError: 'Contact: [EMAIL],[EMAIL]' != 'Contact: [EMAIL],someone.[EMAIL]'
- Contact: [EMAIL],[EMAIL]
+ Contact: [EMAIL],someone.[EMAIL]
? ++++++++
======================================================================
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-1451j9j/test.py", line 160, in test_can_validate_more_complex_phone_numbers
self.assertIs(solution.Validations.is_phone(phone), valid)
AssertionError: True 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-1451j9j/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: True 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-1451j9j/test.py", line 179, in test_handles_multiline_strings_in_hostname_validation_properly
self.assertFalse(solution.Validations.is_hostname("foo.com\n"))
AssertionError: True 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-1451j9j/test.py", line 259, in test_handles_newlines_in_date_validation
self.assertFalse(solution.Validations.is_date("2012-11-19\n"))
AssertionError: True 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-1451j9j/test.py", line 288, in test_handles_newlines_in_time_and_datetime_validation
self.assertFalse(solution.Validations.is_time("12:01:01\n"))
AssertionError: True is not false
----------------------------------------------------------------------
Ran 39 tests in 0.050s
FAILED (failures=8)
История (2 версии и 0 коментара)
Георги обнови решението на 23.04.2014 01:20 (преди над 10 години)
Георги обнови решението на 23.04.2014 02:25 (преди над 10 години)