From 49ddcdc3a696e9e2f5416d1aa40c7ea5845c6c7b Mon Sep 17 00:00:00 2001 From: Richard Nemeth Date: Wed, 13 Jul 2022 22:46:48 +0000 Subject: [PATCH] fix: turn get_name into a method, use setters in connection manager --- src/keycloak/authorization/role.py | 1 - src/keycloak/connection.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/keycloak/authorization/role.py b/src/keycloak/authorization/role.py index 05da243..4ee6ec9 100644 --- a/src/keycloak/authorization/role.py +++ b/src/keycloak/authorization/role.py @@ -38,7 +38,6 @@ class Role: self.name = name self.required = required - @property def get_name(self): """Get name.""" return self.name diff --git a/src/keycloak/connection.py b/src/keycloak/connection.py index 361d95d..44978e5 100644 --- a/src/keycloak/connection.py +++ b/src/keycloak/connection.py @@ -25,7 +25,7 @@ try: from urllib.parse import urljoin -except ImportError: +except ImportError: # pragma: no cover from urlparse import urljoin import requests @@ -46,10 +46,10 @@ class ConnectionManager(object): def __init__(self, base_url, headers={}, timeout=60, verify=True, proxies=None): """Init method.""" - self._base_url = base_url - self._headers = headers - self._timeout = timeout - self._verify = verify + self.base_url = base_url + self.headers = headers + self.timeout = timeout + self.verify = verify self._s = requests.Session() self._s.auth = lambda x: x # don't let requests add auth headers