-
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.
Merge pull request #38 from sul-dlss-labs/t22-rialto-orgs-orcids
Get rialto orgs author ORCIDs
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 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
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,8 +1,27 @@ | ||
import csv | ||
from pathlib import Path | ||
import pytest | ||
from rialto_airflow.utils import create_snapshot_dir, rialto_authors_orcids | ||
|
||
from rialto_airflow.utils import create_snapshot_dir | ||
|
||
@pytest.fixture | ||
def authors_csv(tmp_path): | ||
# Create a fixture authors CSV file | ||
fixture_file = tmp_path / "authors.csv" | ||
with open(fixture_file, "w", newline="") as csvfile: | ||
writer = csv.writer(csvfile) | ||
writer.writerow(["sunetid", "orcidid"]) | ||
writer.writerow(["author1", "https://orcid.org/0000-0000-0000-0001"]) | ||
writer.writerow(["author2", "https://orcid.org/0000-0000-0000-0002"]) | ||
return fixture_file | ||
|
||
|
||
def test_create_snapshot_dir(tmpdir): | ||
snap_dir = Path(create_snapshot_dir(tmpdir)) | ||
assert snap_dir.is_dir() | ||
|
||
|
||
def test_rialto_authors_orcids(tmp_path, authors_csv): | ||
orcids = rialto_authors_orcids(authors_csv) | ||
assert len(orcids) == 2 | ||
assert "https://orcid.org/0000-0000-0000-0001" in orcids |