maven: Use real data from github API + rely on requests_mock_datadir

This commit is contained in:
Valentin Lorentz 2022-10-13 18:28:17 +02:00
parent f7ac524a55
commit db2f2f8265
4 changed files with 364 additions and 11 deletions

View file

@ -0,0 +1,110 @@
{
"id": 133475101,
"node_id": "MDEwOlJlcG9zaXRvcnkxMzM0NzUxMDE=",
"name": "sprova4j",
"full_name": "aldialimucaj/sprova4j",
"private": false,
"owner": {
"login": "aldialimucaj",
"id": 782755,
"node_id": "MDQ6VXNlcjc4Mjc1NQ==",
"avatar_url": "https://avatars.githubusercontent.com/u/782755?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/aldialimucaj",
"html_url": "https://github.com/aldialimucaj",
"followers_url": "https://api.github.com/users/aldialimucaj/followers",
"following_url": "https://api.github.com/users/aldialimucaj/following{/other_user}",
"gists_url": "https://api.github.com/users/aldialimucaj/gists{/gist_id}",
"starred_url": "https://api.github.com/users/aldialimucaj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aldialimucaj/subscriptions",
"organizations_url": "https://api.github.com/users/aldialimucaj/orgs",
"repos_url": "https://api.github.com/users/aldialimucaj/repos",
"events_url": "https://api.github.com/users/aldialimucaj/events{/privacy}",
"received_events_url": "https://api.github.com/users/aldialimucaj/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/aldialimucaj/sprova4j",
"description": "Java client for Sprova Test Framework",
"fork": false,
"url": "https://api.github.com/repos/aldialimucaj/sprova4j",
"forks_url": "https://api.github.com/repos/aldialimucaj/sprova4j/forks",
"keys_url": "https://api.github.com/repos/aldialimucaj/sprova4j/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/aldialimucaj/sprova4j/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/aldialimucaj/sprova4j/teams",
"hooks_url": "https://api.github.com/repos/aldialimucaj/sprova4j/hooks",
"issue_events_url": "https://api.github.com/repos/aldialimucaj/sprova4j/issues/events{/number}",
"events_url": "https://api.github.com/repos/aldialimucaj/sprova4j/events",
"assignees_url": "https://api.github.com/repos/aldialimucaj/sprova4j/assignees{/user}",
"branches_url": "https://api.github.com/repos/aldialimucaj/sprova4j/branches{/branch}",
"tags_url": "https://api.github.com/repos/aldialimucaj/sprova4j/tags",
"blobs_url": "https://api.github.com/repos/aldialimucaj/sprova4j/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/aldialimucaj/sprova4j/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/aldialimucaj/sprova4j/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/aldialimucaj/sprova4j/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/aldialimucaj/sprova4j/statuses/{sha}",
"languages_url": "https://api.github.com/repos/aldialimucaj/sprova4j/languages",
"stargazers_url": "https://api.github.com/repos/aldialimucaj/sprova4j/stargazers",
"contributors_url": "https://api.github.com/repos/aldialimucaj/sprova4j/contributors",
"subscribers_url": "https://api.github.com/repos/aldialimucaj/sprova4j/subscribers",
"subscription_url": "https://api.github.com/repos/aldialimucaj/sprova4j/subscription",
"commits_url": "https://api.github.com/repos/aldialimucaj/sprova4j/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/aldialimucaj/sprova4j/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/aldialimucaj/sprova4j/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/aldialimucaj/sprova4j/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/aldialimucaj/sprova4j/contents/{+path}",
"compare_url": "https://api.github.com/repos/aldialimucaj/sprova4j/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/aldialimucaj/sprova4j/merges",
"archive_url": "https://api.github.com/repos/aldialimucaj/sprova4j/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/aldialimucaj/sprova4j/downloads",
"issues_url": "https://api.github.com/repos/aldialimucaj/sprova4j/issues{/number}",
"pulls_url": "https://api.github.com/repos/aldialimucaj/sprova4j/pulls{/number}",
"milestones_url": "https://api.github.com/repos/aldialimucaj/sprova4j/milestones{/number}",
"notifications_url": "https://api.github.com/repos/aldialimucaj/sprova4j/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/aldialimucaj/sprova4j/labels{/name}",
"releases_url": "https://api.github.com/repos/aldialimucaj/sprova4j/releases{/id}",
"deployments_url": "https://api.github.com/repos/aldialimucaj/sprova4j/deployments",
"created_at": "2018-05-15T07:15:09Z",
"updated_at": "2019-08-13T11:29:54Z",
"pushed_at": "2018-11-08T20:43:59Z",
"git_url": "git://github.com/aldialimucaj/sprova4j.git",
"ssh_url": "git@github.com:aldialimucaj/sprova4j.git",
"clone_url": "https://github.com/aldialimucaj/sprova4j.git",
"svn_url": "https://github.com/aldialimucaj/sprova4j",
"homepage": null,
"size": 87,
"stargazers_count": 2,
"watchers_count": 2,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": {
"key": "apache-2.0",
"name": "Apache License 2.0",
"spdx_id": "Apache-2.0",
"url": "https://api.github.com/licenses/apache-2.0",
"node_id": "MDc6TGljZW5zZTI="
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
],
"visibility": "public",
"forks": 0,
"open_issues": 0,
"watchers": 2,
"default_branch": "master",
"temp_clone_token": null,
"network_count": 0,
"subscribers_count": 1
}

View file

@ -0,0 +1,130 @@
{
"id": 203772666,
"node_id": "MDEwOlJlcG9zaXRvcnkyMDM3NzI2NjY=",
"name": "arangodb-graphql-java",
"full_name": "ArangoDB-Community/arangodb-graphql-java",
"private": false,
"owner": {
"login": "ArangoDB-Community",
"id": 37540306,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjM3NTQwMzA2",
"avatar_url": "https://avatars.githubusercontent.com/u/37540306?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArangoDB-Community",
"html_url": "https://github.com/ArangoDB-Community",
"followers_url": "https://api.github.com/users/ArangoDB-Community/followers",
"following_url": "https://api.github.com/users/ArangoDB-Community/following{/other_user}",
"gists_url": "https://api.github.com/users/ArangoDB-Community/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArangoDB-Community/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArangoDB-Community/subscriptions",
"organizations_url": "https://api.github.com/users/ArangoDB-Community/orgs",
"repos_url": "https://api.github.com/users/ArangoDB-Community/repos",
"events_url": "https://api.github.com/users/ArangoDB-Community/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArangoDB-Community/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/ArangoDB-Community/arangodb-graphql-java",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java",
"forks_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/forks",
"keys_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/teams",
"hooks_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/hooks",
"issue_events_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/issues/events{/number}",
"events_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/events",
"assignees_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/assignees{/user}",
"branches_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/branches{/branch}",
"tags_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/tags",
"blobs_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/statuses/{sha}",
"languages_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/languages",
"stargazers_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/stargazers",
"contributors_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/contributors",
"subscribers_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/subscribers",
"subscription_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/subscription",
"commits_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/contents/{+path}",
"compare_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/merges",
"archive_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/downloads",
"issues_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/issues{/number}",
"pulls_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/pulls{/number}",
"milestones_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/milestones{/number}",
"notifications_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/labels{/name}",
"releases_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/releases{/id}",
"deployments_url": "https://api.github.com/repos/ArangoDB-Community/arangodb-graphql-java/deployments",
"created_at": "2019-08-22T10:38:53Z",
"updated_at": "2022-05-03T21:29:48Z",
"pushed_at": "2022-09-16T21:06:34Z",
"git_url": "git://github.com/ArangoDB-Community/arangodb-graphql-java.git",
"ssh_url": "git@github.com:ArangoDB-Community/arangodb-graphql-java.git",
"clone_url": "https://github.com/ArangoDB-Community/arangodb-graphql-java.git",
"svn_url": "https://github.com/ArangoDB-Community/arangodb-graphql-java",
"homepage": null,
"size": 91,
"stargazers_count": 5,
"watchers_count": 5,
"language": "Java",
"has_issues": true,
"has_projects": false,
"has_downloads": true,
"has_wiki": false,
"has_pages": false,
"forks_count": 1,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 1,
"license": {
"key": "apache-2.0",
"name": "Apache License 2.0",
"spdx_id": "Apache-2.0",
"url": "https://api.github.com/licenses/apache-2.0",
"node_id": "MDc6TGljZW5zZTI="
},
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
],
"visibility": "public",
"forks": 1,
"open_issues": 1,
"watchers": 5,
"default_branch": "master",
"temp_clone_token": null,
"organization": {
"login": "ArangoDB-Community",
"id": 37540306,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjM3NTQwMzA2",
"avatar_url": "https://avatars.githubusercontent.com/u/37540306?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/ArangoDB-Community",
"html_url": "https://github.com/ArangoDB-Community",
"followers_url": "https://api.github.com/users/ArangoDB-Community/followers",
"following_url": "https://api.github.com/users/ArangoDB-Community/following{/other_user}",
"gists_url": "https://api.github.com/users/ArangoDB-Community/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ArangoDB-Community/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ArangoDB-Community/subscriptions",
"organizations_url": "https://api.github.com/users/ArangoDB-Community/orgs",
"repos_url": "https://api.github.com/users/ArangoDB-Community/repos",
"events_url": "https://api.github.com/users/ArangoDB-Community/events{/privacy}",
"received_events_url": "https://api.github.com/users/ArangoDB-Community/received_events",
"type": "Organization",
"site_admin": false
},
"network_count": 1,
"subscribers_count": 17
}

View file

@ -0,0 +1,124 @@
{
"id": 2618757,
"node_id": "MDEwOlJlcG9zaXRvcnkyNjE4NzU3",
"name": "citrus",
"full_name": "webx/citrus",
"private": false,
"owner": {
"login": "webx",
"id": 1142574,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjExNDI1NzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/1142574?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/webx",
"html_url": "https://github.com/webx",
"followers_url": "https://api.github.com/users/webx/followers",
"following_url": "https://api.github.com/users/webx/following{/other_user}",
"gists_url": "https://api.github.com/users/webx/gists{/gist_id}",
"starred_url": "https://api.github.com/users/webx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/webx/subscriptions",
"organizations_url": "https://api.github.com/users/webx/orgs",
"repos_url": "https://api.github.com/users/webx/repos",
"events_url": "https://api.github.com/users/webx/events{/privacy}",
"received_events_url": "https://api.github.com/users/webx/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/webx/citrus",
"description": "Java-based Web Framework for Alibaba Group",
"fork": false,
"url": "https://api.github.com/repos/webx/citrus",
"forks_url": "https://api.github.com/repos/webx/citrus/forks",
"keys_url": "https://api.github.com/repos/webx/citrus/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/webx/citrus/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/webx/citrus/teams",
"hooks_url": "https://api.github.com/repos/webx/citrus/hooks",
"issue_events_url": "https://api.github.com/repos/webx/citrus/issues/events{/number}",
"events_url": "https://api.github.com/repos/webx/citrus/events",
"assignees_url": "https://api.github.com/repos/webx/citrus/assignees{/user}",
"branches_url": "https://api.github.com/repos/webx/citrus/branches{/branch}",
"tags_url": "https://api.github.com/repos/webx/citrus/tags",
"blobs_url": "https://api.github.com/repos/webx/citrus/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/webx/citrus/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/webx/citrus/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/webx/citrus/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/webx/citrus/statuses/{sha}",
"languages_url": "https://api.github.com/repos/webx/citrus/languages",
"stargazers_url": "https://api.github.com/repos/webx/citrus/stargazers",
"contributors_url": "https://api.github.com/repos/webx/citrus/contributors",
"subscribers_url": "https://api.github.com/repos/webx/citrus/subscribers",
"subscription_url": "https://api.github.com/repos/webx/citrus/subscription",
"commits_url": "https://api.github.com/repos/webx/citrus/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/webx/citrus/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/webx/citrus/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/webx/citrus/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/webx/citrus/contents/{+path}",
"compare_url": "https://api.github.com/repos/webx/citrus/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/webx/citrus/merges",
"archive_url": "https://api.github.com/repos/webx/citrus/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/webx/citrus/downloads",
"issues_url": "https://api.github.com/repos/webx/citrus/issues{/number}",
"pulls_url": "https://api.github.com/repos/webx/citrus/pulls{/number}",
"milestones_url": "https://api.github.com/repos/webx/citrus/milestones{/number}",
"notifications_url": "https://api.github.com/repos/webx/citrus/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/webx/citrus/labels{/name}",
"releases_url": "https://api.github.com/repos/webx/citrus/releases{/id}",
"deployments_url": "https://api.github.com/repos/webx/citrus/deployments",
"created_at": "2011-10-21T07:34:55Z",
"updated_at": "2022-10-12T13:24:54Z",
"pushed_at": "2022-10-10T02:41:17Z",
"git_url": "git://github.com/webx/citrus.git",
"ssh_url": "git@github.com:webx/citrus.git",
"clone_url": "https://github.com/webx/citrus.git",
"svn_url": "https://github.com/webx/citrus",
"homepage": "http://www.openwebx.org/",
"size": 7512,
"stargazers_count": 756,
"watchers_count": 756,
"language": "Java",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 376,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 32,
"license": null,
"allow_forking": true,
"is_template": false,
"web_commit_signoff_required": false,
"topics": [
],
"visibility": "public",
"forks": 376,
"open_issues": 32,
"watchers": 756,
"default_branch": "master",
"temp_clone_token": null,
"organization": {
"login": "webx",
"id": 1142574,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjExNDI1NzQ=",
"avatar_url": "https://avatars.githubusercontent.com/u/1142574?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/webx",
"html_url": "https://github.com/webx",
"followers_url": "https://api.github.com/users/webx/followers",
"following_url": "https://api.github.com/users/webx/following{/other_user}",
"gists_url": "https://api.github.com/users/webx/gists{/gist_id}",
"starred_url": "https://api.github.com/users/webx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/webx/subscriptions",
"organizations_url": "https://api.github.com/users/webx/orgs",
"repos_url": "https://api.github.com/users/webx/repos",
"events_url": "https://api.github.com/users/webx/events{/privacy}",
"received_events_url": "https://api.github.com/users/webx/received_events",
"type": "Organization",
"site_admin": false
},
"network_count": 376,
"subscribers_count": 136
}

View file

@ -77,17 +77,6 @@ def maven_index_null_mtime(datadir) -> bytes:
@pytest.fixture(autouse=True)
def network_requests_mock(requests_mock, requests_mock_datadir, maven_index_full):
# If github api calls for the configured scm repository, returns its canonical url.
for url_api, url_html in [
(GIT_REPO_URL0_API, GIT_REPO_URL0_HTTPS),
(GIT_REPO_URL1_API, GIT_REPO_URL1_HTTPS),
(GIT_REPO_URL2_API, GIT_REPO_URL2_HTTPS),
]:
requests_mock.get(
url_api,
json={"html_url": url_html},
)
requests_mock.get(INDEX_URL, content=maven_index_full)