import requests


def test_token(token: str, url: str, dev: bool) -> bool:
	"""Tests the OAuth2 token currently stored for the active user.
	:param token: Token for the current user
	:param url: The URL for the canvas installation of the current user
	:param dev: If the developer token provided to NARC is on a secure server or unsecured
	:return: If the request returned a positive result
	"""
	simple_request = requests.get(f"https://{url}/api/v1/courses", headers={"Authorization": f"Bearer {token}"},
	                              verify=False is dev)
	return simple_request.status_code == 200