-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
7 changed files
with
201 additions
and
5 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,3 +6,5 @@ rf_password: "secret" | |
email: "[email protected]" | ||
# URL of the export of publications from NBIROS in XML format | ||
nbiros_pub_export_xml_url: "https://example.org/path/to/pubs.xml" | ||
# URL of the export of EI people data in CSV format | ||
people_data_csv_url: "https://example.org/path/to/people.csv" |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
pythonpath = . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from rfparser.util import ( | ||
is_same_person, | ||
unique, | ||
) | ||
|
||
|
||
def test_is_same_person(): | ||
assert is_same_person("Doe", "John", "Doe", "John") | ||
assert not is_same_person("Doe", "John", "Doe", "Mary") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "John Paul") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "John Paul") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "John P") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "J P") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "J-P") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "J") | ||
assert is_same_person("Doe", "John-Paul", "Doe", "J.") | ||
assert not is_same_person("Doe", "John", "D", "J") | ||
assert is_same_person("Doe", "John Jr.", "Doe", "John Jr") | ||
assert is_same_person("Foo-Bar", "John", "Foo Bar", "John") | ||
assert not is_same_person("Foo-Bar", "John", "Foo Doe", "John") | ||
assert not is_same_person("Foo-Bar", "John", "Foo-Bar", "Mary") | ||
assert is_same_person("Foo-Bar", "John", "Foo", "John") | ||
assert is_same_person("Foo Bar", "John", "Foo", "John") | ||
assert is_same_person("McFoo", "John", "Mcfoo", "John") | ||
assert is_same_person("Doe", "John", "Doe", "john") | ||
assert is_same_person("Doe", "", "Doe", "") | ||
assert not is_same_person("Doe", "John", "Doe", "") | ||
|
||
|
||
def test_unique(): | ||
assert unique([]) == [] | ||
assert unique(["a", "b", "a", "c", "b"]) == ["a", "b", "c"] | ||
assert unique([3, 2, 2, 1, 3]) == [3, 2, 1] |
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
[tox] | ||
# envlist is the list of environments that are tested when `tox` is run without any option | ||
# hyphens in an environment name are used to delimit factors | ||
envlist = lint, mypy | ||
skipsdist = True | ||
envlist = lint, mypy,test | ||
|
||
[testenv] | ||
commands = | ||
lint: ruff . | ||
lint: flake8 . | ||
mypy: mypy rfparser/ | ||
test: pytest | ||
deps = | ||
lint: ruff | ||
lint: flake8 | ||
lint: flake8-bugbear | ||
mypy: mypy | ||
mypy: types-requests | ||
mypy: types-PyYAML | ||
test: pytest | ||
skip_install = | ||
lint: True |