Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix incorrect tests for task 04-re.
  • Loading branch information
bobeff committed May 18, 2014
commit 77402beafcae50c21daeb828a83db18981eff8d9
9 changes: 6 additions & 3 deletions 2014/04-re/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_filters_more_complex_phone_numbers(self):

def test_does_not_filter_invalid_phone_numbers(self):
invalid_phone_numbers = {
'Reach me at: 0885123': 'Reach me at: 0885123',
'Reach me at: 0885123': 'Reach me at: [PHONE]',
'0005551234569': '0005551234569',
'+1555 123, 55555': '+1555 123, 55555',
'95551212': '95551212',
Expand All @@ -99,7 +99,7 @@ def test_filters_more_than_one_phone_or_email(self):
filtered = """
Contacts

Phones: [PHONE] or [PHONE]
Phones:_+1_(555) 123-456-99 or [PHONE]
Email: [EMAIL] or [EMAIL]
"""

Expand Down Expand Up @@ -171,7 +171,7 @@ def test_can_validate_more_complex_phone_numbers(self):
'0044 1 21 25 543': True,
' 0044 1 21 25 543 ': False,
'Why? 0044 1 21 25 543': False,
'0885123': False,
'0885123': True,
'0005551234569': False,
'+1555 123, 55555': False,
'95551212': False,
Expand Down Expand Up @@ -318,3 +318,6 @@ def test_handles_newlines_in_time_and_datetime_validation(self):
self.assertFalse(solution.Validations.is_time("12:01:01\n"))
self.assertFalse(solution.Validations.is_time("12:01:01\n12:02:02"))
self.assertFalse(solution.Validations.is_datetime("2012-11-19 12:01:01\n"))

if __name__ == '__main__':
unittest.main()