Skip to content

Commit

Permalink
Get Test Case Statuses #108 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolstislon authored Jul 15, 2024
1 parent 88d26a7 commit 06a5ee3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions testrail_api/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ def user_email(self) -> str:
@staticmethod
def __get_url(url: str, warn_ignore: bool) -> str:
"""Reading URL"""
_url = url or environ.get(Environ.URL)
if not _url:
if not (_url := url or environ.get(Environ.URL)):
raise TestRailError(f"Url is not set. Use argument url or env {Environ.URL}")
_url = _url.rstrip("/")
if _url.startswith("http://") and not warn_ignore:
Expand All @@ -125,16 +124,14 @@ def __get_url(url: str, warn_ignore: bool) -> str:
@staticmethod
def __get_email(email: Optional[str]) -> str:
"""Reading email"""
_email = email or environ.get(Environ.EMAIL)
if not _email:
if not (_email := email or environ.get(Environ.EMAIL)):
raise TestRailError(f"Email is not set. Use argument email or env {Environ.EMAIL}")
return _email

@staticmethod
def __get_password(password: str) -> str:
"""Reading password"""
_password = password or environ.get(Environ.PASSWORD)
if not _password:
if not (_password := password or environ.get(Environ.PASSWORD)):
raise TestRailError(f"Password is not set. Use argument password or env {Environ.PASSWORD}")
return _password

Expand Down

0 comments on commit 06a5ee3

Please sign in to comment.