-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use display_name for "username" instead of first_name, last_name (#1640)
- Loading branch information
1 parent
ffc545b
commit 092764b
Showing
28 changed files
with
134 additions
and
162 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 |
---|---|---|
|
@@ -187,6 +187,33 @@ def test_parse_tag(): | |
assert result == expected | ||
|
||
|
||
def test_extract_name(): | ||
sample = "Tester Testerson <tester -at- gmail.com>" | ||
expected = "Tester Testerson" | ||
result = GithubDataParser().extract_name(sample) | ||
assert expected == result | ||
|
||
sample = "Tester Testerson" | ||
expected = "Tester Testerson" | ||
result = GithubDataParser().extract_name(sample) | ||
assert expected == result | ||
|
||
sample = "Tester de Testerson <tester -at- gmail.com>" | ||
expected = "Tester de Testerson" | ||
result = GithubDataParser().extract_name(sample) | ||
assert expected == result | ||
|
||
sample = "Tester de Testerson" | ||
expected = "Tester de Testerson" | ||
result = GithubDataParser().extract_name(sample) | ||
assert expected == result | ||
|
||
sample = "Various" | ||
expected = "Various" | ||
result = GithubDataParser().extract_name(sample) | ||
assert expected == result | ||
|
||
|
||
def test_extract_names(): | ||
sample = "Tester Testerson <tester -at- gmail.com>" | ||
expected = ["Tester", "Testerson"] | ||
|
@@ -255,20 +282,17 @@ def test_extract_contributor_data(): | |
expected = { | ||
"valid_email": True, | ||
"email": "[email protected]", | ||
"first_name": "Tester", | ||
"last_name": "Testerson", | ||
"display_name": "Tester Testerson", | ||
} | ||
result = GithubDataParser().extract_contributor_data(sample) | ||
assert expected == result | ||
|
||
sample = "Tester Testerson" | ||
expected = { | ||
"valid_email": False, | ||
"first_name": "Tester", | ||
"last_name": "Testerson", | ||
"display_name": "Tester Testerson", | ||
} | ||
result = GithubDataParser().extract_contributor_data(sample) | ||
assert expected["valid_email"] is False | ||
assert expected["first_name"] == result["first_name"] | ||
assert expected["last_name"] == result["last_name"] | ||
assert expected["display_name"] == result["display_name"] | ||
assert "email" in result |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.