Skip to content
Snippets Groups Projects
Commit 00d2d9bb authored by vlorentz's avatar vlorentz
Browse files

github: Map 'subscribers' instead of 'watchers' to ForgeFed 'followers'

On Github's API, 'watchers' is synonymous with 'stargazers', which does NOT map
to 'watching' on Github's UI.
parent 5b5cbf6d
Loading
Pipeline #14001 passed
......@@ -153,12 +153,12 @@ class GitHubMapping(BaseExtrinsicMapping, JsonMapping):
)
@produce_terms(ACTIVITYSTREAMS.followers, ACTIVITYSTREAMS.totalItems)
def translate_watchers_count(self, graph: Graph, root: BNode, v: Any) -> None:
def translate_subscribers_count(self, graph: Graph, root: BNode, v: Any) -> None:
"""
>>> graph = Graph()
>>> root = URIRef("http://example.org/test-software")
>>> GitHubMapping().translate_watchers_count(graph, root, 42)
>>> GitHubMapping().translate_subscribers_count(graph, root, 42)
>>> prettyprint_graph(graph, root)
{
"@id": ...,
......
......@@ -101,7 +101,7 @@ def test_compute_metadata_github():
"visibility": "public",
"forks": 1,
"open_issues": 0,
"watchers": 13,
"watchers": 12,
"default_branch": "master",
"temp_clone_token": null,
"organization": {
......@@ -140,7 +140,7 @@ def test_compute_metadata_github():
"as:followers": {
"as:totalItems": {
"type": "xsd:nonNegativeInteger",
"@value": "12",
"@value": "6",
},
"type": "as:Collection",
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment