-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d79fee
commit 78de5d9
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,49 @@ | |
|
||
class TestEmail(unittest.TestCase): | ||
|
||
def test_bugs_1(self): | ||
# http://philipperemy.ddns.net:9999/[email protected] | ||
# http://philipperemy.ddns.net:9999/[email protected] | ||
# It seems that always expect at least 2 parameters. | ||
# If you try: http://philipperemy.ddns.net:9999/[email protected] it works but not form | ||
# http://philipperemy.ddns.net:9999/[email protected] | ||
# or | ||
# http://philipperemy.ddns.net:9999/[email protected] | ||
inputs = [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]' | ||
] | ||
|
||
outputs = [ | ||
['remy', None], | ||
[None, 'remy'], | ||
['remy', None], | ||
] | ||
|
||
outputs2 = [ | ||
['remy', None, None], | ||
['remy', None, None], | ||
['remy', None, None], | ||
['remy', None, None], | ||
] | ||
|
||
nd = NameDataset() | ||
for input_, output_, output2_ in zip(inputs, outputs, outputs2): | ||
first_name, last_name = extract_names_from_email(nd, input_) | ||
print(input_) | ||
print('output=', first_name, last_name) | ||
print('expected=', output_[0], output_[1]) | ||
self.assertEqual(output_[0], first_name) | ||
self.assertEqual(output_[1], last_name) | ||
|
||
first_name, last_name, last_name2 = try_to_split_with_two_last_names(nd, input_) | ||
|
||
self.assertEqual(output2_[0], first_name) | ||
self.assertEqual(output2_[1], last_name) | ||
self.assertEqual(output2_[2], last_name2) | ||
print('[OK]') | ||
|
||
def test_with_three_3(self): | ||
inputs = [ | ||
'perezmartiisabel', | ||
|