Use GraphQL for GitHub integration (#66928)

This commit is contained in:
Joakim Sørensen 2022-02-20 11:59:11 +01:00 committed by GitHub
parent 4ca339c5b1
commit 9f57ce504b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 201 additions and 1144 deletions

View file

@ -31,12 +31,11 @@ async def setup_github_integration(
},
headers=headers,
)
for endpoint in ("issues", "pulls", "releases", "commits"):
aioclient_mock.get(
f"https://api.github.com/repos/{repository}/{endpoint}",
json=json.loads(load_fixture(f"{endpoint}.json", DOMAIN)),
headers=headers,
)
aioclient_mock.post(
"https://api.github.com/graphql",
json=json.loads(load_fixture("graphql.json", DOMAIN)),
headers=headers,
)
mock_config_entry.add_to_hass(hass)
setup_result = await hass.config_entries.async_setup(mock_config_entry.entry_id)