sympasoap is not a dependency is test env

This commit is contained in:
Yohann D'ANELLO 2020-10-09 14:18:27 +02:00
parent d62cb40acd
commit 6e8b6fbc66
1 changed files with 2 additions and 3 deletions

View File

@ -1,14 +1,13 @@
import os
from sympasoap import Client
_client = None
def get_sympa_client() -> Client:
def get_sympa_client():
global _client
if _client is None:
if os.getenv("SYMPA_PASSWORD", None) is not None:
from sympasoap import Client
_client = Client("https://" + os.getenv("SYMPA_URL"))
_client.login(os.getenv("SYMPA_EMAIL"), os.getenv("SYMPA_PASSWORD"))
else: