-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
authors: builder add bluesky and mastodon
* ref: cern-sis/issues-inspire#619
- Loading branch information
Showing
2 changed files
with
60 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 |
---|---|---|
|
@@ -416,6 +416,34 @@ def test_add_twitter(): | |
assert expected == result | ||
|
||
|
||
def test_add_bluesky(): | ||
schema = load_schema('authors') | ||
subschema = schema['properties']['ids'] | ||
|
||
author = AuthorBuilder() | ||
author.add_bluesky('kylecranmer.bsky.social') | ||
|
||
expected = [{"value": "kylecranmer.bsky.social", "schema": "BLUESKY"}] | ||
result = author.obj['ids'] | ||
|
||
assert validate(result, subschema) is None | ||
assert expected == result | ||
|
||
|
||
def test_add_mastodon(): | ||
schema = load_schema('authors') | ||
subschema = schema['properties']['ids'] | ||
|
||
author = AuthorBuilder() | ||
author.add_mastodon('[email protected]') | ||
|
||
expected = [{"value": "[email protected]", "schema": "MASTODON"}] | ||
result = author.obj['ids'] | ||
|
||
assert validate(result, subschema) is None | ||
assert expected == result | ||
|
||
|
||
def test_add_orcid(): | ||
schema = load_schema('authors') | ||
subschema = schema['properties']['ids'] | ||
|