def test_refresh(self, get_client: MagicMock, save_connection: MagicMock, get_config: MagicMock, create_keypair: MagicMock, check_certificate: MagicMock, get_info: MagicMock, get_cert_key: MagicMock, get_storage: MagicMock, _: MagicMock): create_keypair.return_value = "key", "cert" check_certificate.return_value = False get_cert_key.return_value = "cert", "key" get_storage.return_value = "uuid", "auth_url", ({}, "", "", "", "", "", "", "", "", None, None) get_info.return_value = "api_base_uri", "token_endpoint", "auth_endpoint" refresh()
def test_refresh_invalid_signature( self, get_client: MagicMock, save_connection: MagicMock, get_config: MagicMock, create_keypair: MagicMock, check_certificate: MagicMock, get_info: MagicMock, get_cert_key: MagicMock, get_storage: MagicMock, oauth: MagicMock): oauth.refresh_token = MagicMock( side_effect=InvalidGrantError("invalid signature")) create_keypair.return_value = "key", "cert" check_certificate.return_value = False get_cert_key.return_value = "cert", "key" get_storage.return_value = "uuid", "auth_url", ({}, "", "", "", "", "", "", "", "", None, None) get_info.return_value = "api_base_uri", "token_endpoint", "auth_endpoint" refresh()
def refresh(_): actions.refresh()