tcms-api 13.3__tar.gz → 17.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: tcms-api
3
- Version: 13.3
4
- Summary: Python API for Kiwi
3
+ Version: 17.3
4
+ Summary: Python API for Kiwi TCMS
5
5
  Home-page: https://github.com/kiwitcms/tcms-api
6
6
  Maintainer: Kiwi TCMS
7
7
  Maintainer-email: info@kiwitcms.org
@@ -10,20 +10,25 @@ Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Environment :: Console
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: System Administrators
13
- Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
14
13
  Classifier: Operating System :: POSIX
15
14
  Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.14
19
16
  Classifier: Topic :: Software Development
20
17
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
18
  Classifier: Topic :: Software Development :: Quality Assurance
22
19
  Classifier: Topic :: Software Development :: Testing
23
- Requires-Python: >=3.6
20
+ Requires-Python: >=3.9
24
21
  Description-Content-Type: text/x-rst
25
- Provides-Extra: gssapi
26
22
  License-File: LICENSE
23
+ Dynamic: classifier
24
+ Dynamic: description
25
+ Dynamic: description-content-type
26
+ Dynamic: home-page
27
+ Dynamic: license-file
28
+ Dynamic: maintainer
29
+ Dynamic: maintainer-email
30
+ Dynamic: requires-python
31
+ Dynamic: summary
27
32
 
28
33
  Python API for Kiwi TCMS
29
34
  ========================
@@ -42,14 +47,6 @@ Python API for Kiwi TCMS
42
47
  :target: https://codecov.io/gh/kiwitcms/tcms-api
43
48
  :alt: Code coverage
44
49
 
45
- .. image:: https://tidelift.com/badges/package/pypi/tcms-api
46
- :target: https://tidelift.com/subscription/pkg/pypi-tcms-api?utm_source=pypi-tcms-api&utm_medium=github&utm_campaign=readme
47
- :alt: Tidelift
48
-
49
- .. image:: https://opencollective.com/kiwitcms/tiers/sponsor/badge.svg?label=sponsors&color=brightgreen
50
- :target: https://opencollective.com/kiwitcms#contributors
51
- :alt: Become a sponsor
52
-
53
50
  .. image:: https://img.shields.io/twitter/follow/KiwiTCMS.svg
54
51
  :target: https://twitter.com/KiwiTCMS
55
52
  :alt: Kiwi TCMS on Twitter
@@ -67,6 +64,29 @@ https://tcms-api.readthedocs.io/en/latest/modules/tcms_api.html
67
64
  CHANGELOG
68
65
  ---------
69
66
 
67
+ v17.3 (03 Dec 2026)
68
+ ~~~~~~~~~~~~~~~~~~~
69
+
70
+ - Allow additional HTTP headers (Josh Lubawy)
71
+ - Add reference in CI yaml how to override CA trust stores. Closes
72
+ `Issue #56 <https://github.com/kiwitcms/tcms-api/issues/56>`_
73
+ - Add ``TestCase`` decorator for stable test case identification. Closes
74
+ `Issue #126 <https://github.com/kiwitcms/tcms-api/issues/126>`_
75
+ - Add support for bearer token authentication - specify ``token`` field in
76
+ ``tcms.conf`` or pass via ``extra_headers`` to ``TCMS()`` class
77
+ - Remove Kerberos integration - removed in Kiwi TCMS Enterprise v16.5-mt
78
+ - Require Python 3.9 or later
79
+
80
+
81
+ v15.0 (22 Sep 2025)
82
+ ~~~~~~~~~~~~~~~~~~~
83
+
84
+ - Include host URL in Referer header
85
+ - Updates for newer pylint
86
+ - Updates for newer Sphynx
87
+ - Update GitHub actions
88
+
89
+
70
90
  v13.3 (10 Jun 2024)
71
91
  ~~~~~~~~~~~~~~~~~~~
72
92
 
@@ -213,7 +233,7 @@ v9.0 (12 January 2021)
213
233
  - Compatible with Kiwi TCMS v9.0 or later
214
234
  - Method ``Backend.build_id()`` doesn't receive ``product_id`` as firsts
215
235
  parameter anymore! Related to Kiwi TCMS
216
- `Issue #246 <https://github.com/kiwitcms/Kiwi/issues/246>`_
236
+ `Issue #246 <https://github.com/kiwitcms/kiwitcms/issues/246>`_
217
237
 
218
238
 
219
239
  v8.6.0 (28 October 2020)
@@ -15,14 +15,6 @@ Python API for Kiwi TCMS
15
15
  :target: https://codecov.io/gh/kiwitcms/tcms-api
16
16
  :alt: Code coverage
17
17
 
18
- .. image:: https://tidelift.com/badges/package/pypi/tcms-api
19
- :target: https://tidelift.com/subscription/pkg/pypi-tcms-api?utm_source=pypi-tcms-api&utm_medium=github&utm_campaign=readme
20
- :alt: Tidelift
21
-
22
- .. image:: https://opencollective.com/kiwitcms/tiers/sponsor/badge.svg?label=sponsors&color=brightgreen
23
- :target: https://opencollective.com/kiwitcms#contributors
24
- :alt: Become a sponsor
25
-
26
18
  .. image:: https://img.shields.io/twitter/follow/KiwiTCMS.svg
27
19
  :target: https://twitter.com/KiwiTCMS
28
20
  :alt: Kiwi TCMS on Twitter
@@ -40,6 +32,29 @@ https://tcms-api.readthedocs.io/en/latest/modules/tcms_api.html
40
32
  CHANGELOG
41
33
  ---------
42
34
 
35
+ v17.3 (03 Dec 2026)
36
+ ~~~~~~~~~~~~~~~~~~~
37
+
38
+ - Allow additional HTTP headers (Josh Lubawy)
39
+ - Add reference in CI yaml how to override CA trust stores. Closes
40
+ `Issue #56 <https://github.com/kiwitcms/tcms-api/issues/56>`_
41
+ - Add ``TestCase`` decorator for stable test case identification. Closes
42
+ `Issue #126 <https://github.com/kiwitcms/tcms-api/issues/126>`_
43
+ - Add support for bearer token authentication - specify ``token`` field in
44
+ ``tcms.conf`` or pass via ``extra_headers`` to ``TCMS()`` class
45
+ - Remove Kerberos integration - removed in Kiwi TCMS Enterprise v16.5-mt
46
+ - Require Python 3.9 or later
47
+
48
+
49
+ v15.0 (22 Sep 2025)
50
+ ~~~~~~~~~~~~~~~~~~~
51
+
52
+ - Include host URL in Referer header
53
+ - Updates for newer pylint
54
+ - Updates for newer Sphynx
55
+ - Update GitHub actions
56
+
57
+
43
58
  v13.3 (10 Jun 2024)
44
59
  ~~~~~~~~~~~~~~~~~~~
45
60
 
@@ -186,7 +201,7 @@ v9.0 (12 January 2021)
186
201
  - Compatible with Kiwi TCMS v9.0 or later
187
202
  - Method ``Backend.build_id()`` doesn't receive ``product_id`` as firsts
188
203
  parameter anymore! Related to Kiwi TCMS
189
- `Issue #246 <https://github.com/kiwitcms/Kiwi/issues/246>`_
204
+ `Issue #246 <https://github.com/kiwitcms/kiwitcms/issues/246>`_
190
205
 
191
206
 
192
207
  v8.6.0 (28 October 2020)
File without changes
@@ -1,3 +1,7 @@
1
+ [metadata]
2
+ license = LGPLv2+
3
+ license_files = LICENSE
4
+
1
5
  [flake8]
2
6
  max-line-length = 102
3
7
  extend-ignore = E203
@@ -35,30 +35,22 @@ setup(
35
35
  name="tcms-api",
36
36
  version=get_version(),
37
37
  packages=["tcms_api"],
38
- description="Python API for Kiwi",
38
+ description="Python API for Kiwi TCMS",
39
39
  long_description=LONG_DESCRIPTION,
40
40
  long_description_content_type="text/x-rst",
41
41
  maintainer="Kiwi TCMS",
42
42
  maintainer_email="info@kiwitcms.org",
43
- license="LGPLv2+",
44
43
  url="https://github.com/kiwitcms/tcms-api",
45
- python_requires=">=3.6",
44
+ python_requires=">=3.9",
46
45
  install_requires=get_install_requires("requirements.txt"),
47
- extras_require={
48
- "gssapi": ["gssapi"],
49
- },
50
46
  classifiers=[
51
47
  "Development Status :: 5 - Production/Stable",
52
48
  "Environment :: Console",
53
49
  "Intended Audience :: Developers",
54
50
  "Intended Audience :: System Administrators",
55
- "License :: OSI Approved :: GNU Lesser General Public License v2"
56
- + " or later (LGPLv2+)",
57
51
  "Operating System :: POSIX",
58
52
  "Programming Language :: Python",
59
- "Programming Language :: Python :: 3.8",
60
- "Programming Language :: Python :: 3.9",
61
- "Programming Language :: Python :: 3.11",
53
+ "Programming Language :: Python :: 3.14",
62
54
  "Topic :: Software Development",
63
55
  "Topic :: Software Development :: Libraries :: Python Modules",
64
56
  "Topic :: Software Development :: Quality Assurance",
@@ -32,22 +32,6 @@ Installation::
32
32
  pip install tcms-api
33
33
 
34
34
 
35
- If you want to use Kerberos then::
36
-
37
- pip install tcms-api[gssapi]
38
-
39
- **WARNING:** on Windows you need to install MIT Kerberos and make sure
40
- ``C:\\Program Files\\MIT\\Kerberos\\bin`` is included in ``%PATH%`` -
41
- this is usually the case when you install and restart! It must be
42
- a 64bit installation, see
43
- `MIT Kerberos for Windows 4.1 <https://web.mit.edu/kerberos/dist/index.html#kfw-4.1>`_
44
-
45
- **WARNING:** on Linux you will need gcc, Python and kerberos devel packages to
46
- build ``gssapi`` because it doesn't provide binary packages via PyPI. Try
47
- ``dnf install gcc krb5-devel python3-devel`` (Red Hat/Fedora) or
48
- ``apt-get install gcc libkrb5-dev libpython3-dev`` (Debian/Ubuntu).
49
-
50
-
51
35
  Minimal config file ``~/.tcms.conf``::
52
36
 
53
37
  [tcms]
@@ -55,13 +39,15 @@ Minimal config file ``~/.tcms.conf``::
55
39
  username = your-username
56
40
  password = your-password
57
41
 
58
- For Kerberos specify the ``use_kerberos = True`` key without username
59
- and password! Also make sure that your ``/etc/krb5.conf`` contains::
42
+ To authenticate with an OAuth2 bearer token instead of username/password::
60
43
 
61
- [libdefaults]
62
- default_realm = .EXAMPLE.COM
44
+ [tcms]
45
+ url = https://tcms.server/xml-rpc/
46
+ token = your-access-token
63
47
 
64
- where ``EXAMPLE.COM`` matches the realm in your organization.
48
+ Token authentication requires HTTPS. When both ``token`` and ``username``/``password``
49
+ are configured, the token takes precedence. An explicit ``Authorization`` header
50
+ passed via ``extra_headers`` takes precedence over a configured ``token``.
65
51
 
66
52
 
67
53
  .. important::
@@ -95,6 +81,13 @@ arguments when initializing the TCMS() class::
95
81
 
96
82
  TCMS("https://kiwitcms.example.com/xml-rpc/", "api-bot", "keep-me-secret").exec
97
83
 
84
+ Tokens can also be passed as an HTTP header, without username/password::
85
+
86
+ TCMS(
87
+ "https://kiwitcms.example.com/xml-rpc/",
88
+ extra_headers={"Authorization": "Bearer <token>"},
89
+ ).exec
90
+
98
91
 
99
92
  .. important::
100
93
 
@@ -106,23 +99,25 @@ arguments when initializing the TCMS() class::
106
99
  to open a pull request with your own examples!
107
100
 
108
101
  """
102
+
109
103
  import os
110
104
  from configparser import ConfigParser
111
105
  from datetime import datetime, timedelta
106
+ from typing import Optional
112
107
 
113
- try:
114
- from distutils.util import strtobool # pylint: disable=deprecated-module
115
- except ModuleNotFoundError:
116
- from setuptools.dist import strtobool
117
-
118
- from tcms_api.xmlrpc import TCMSXmlrpc, TCMSKerbXmlrpc
108
+ from tcms_api.xmlrpc import TCMSXmlrpc
119
109
 
120
110
 
121
111
  class _ConnectionProxy:
122
- def __init__(self, config):
112
+ def __init__(
113
+ self,
114
+ config,
115
+ extra_headers: Optional[dict[str, str]] = None,
116
+ ):
123
117
  self.__connected_since = datetime(2024, 1, 1, 0, 0)
124
118
  self.__connection = None
125
119
  self.__config = config
120
+ self.__extra_headers = extra_headers or {}
126
121
 
127
122
  @staticmethod
128
123
  def server_url(config):
@@ -138,6 +133,8 @@ class _ConnectionProxy:
138
133
  return config["tcms"]["url"].replace("json-rpc", "xml-rpc")
139
134
 
140
135
  def create_connection(self):
136
+ path = None
137
+
141
138
  # try authentication credentials from Python arguments first
142
139
  if self.__config["tcms"]["url"]:
143
140
  config = self.__config
@@ -157,22 +154,38 @@ class _ConnectionProxy:
157
154
  config = ConfigParser()
158
155
  config.read(path)
159
156
 
160
- rpc_implementor = None
161
157
  server_url = self.server_url(config)
162
- if strtobool(config["tcms"].get("use_kerberos", "False")):
163
- # use Kerberos
164
- rpc_implementor = TCMSKerbXmlrpc(None, None, server_url)
158
+
159
+ token = config["tcms"].get("token")
160
+ extra_headers = dict(self.__extra_headers)
161
+ has_authorization = any(
162
+ header.lower() == "authorization" for header in extra_headers
163
+ )
164
+
165
+ # use a configured token only when no Authorization header was passed
166
+ if token and not has_authorization:
167
+ extra_headers["Authorization"] = f"Bearer {token}"
168
+ has_authorization = True
169
+
170
+ if has_authorization:
171
+ username = None
172
+ password = None
165
173
  else:
166
174
  try:
167
- # use password authentication
168
- rpc_implementor = TCMSXmlrpc(
169
- config["tcms"]["username"],
170
- config["tcms"]["password"],
171
- server_url,
172
- )
175
+ username = config["tcms"]["username"]
176
+ password = config["tcms"]["password"]
177
+ if not (username and password):
178
+ raise KeyError("username/password")
173
179
  except KeyError as err:
174
180
  raise RuntimeError(f"username/password required in '{path}'") from err
175
181
 
182
+ rpc_implementor = TCMSXmlrpc(
183
+ username,
184
+ password,
185
+ server_url,
186
+ extra_headers=extra_headers,
187
+ )
188
+
176
189
  self.__connected_since = datetime.now()
177
190
  return rpc_implementor.server
178
191
 
@@ -206,7 +219,13 @@ class TCMS: # pylint: disable=too-few-public-methods
206
219
  parses user configuration using a utilities class!
207
220
  """
208
221
 
209
- def __init__(self, url=None, username=None, password=None):
222
+ def __init__(
223
+ self,
224
+ url=None,
225
+ username=None,
226
+ password=None,
227
+ extra_headers: Optional[dict[str, str]] = None,
228
+ ):
210
229
  self.config = {
211
230
  "tcms": {
212
231
  "url": url,
@@ -215,6 +234,8 @@ class TCMS: # pylint: disable=too-few-public-methods
215
234
  }
216
235
  }
217
236
 
237
+ self.extra_headers = extra_headers or {}
238
+
218
239
  @property
219
240
  def exec(self):
220
241
  """
@@ -230,4 +251,7 @@ class TCMS: # pylint: disable=too-few-public-methods
230
251
  Starting with tcms-api v12.9.1 this property is automatically refreshed
231
252
  every 4 minutes to avoid SSL connection timeout errors!
232
253
  """
233
- return _ConnectionProxy(self.config)
254
+ return _ConnectionProxy(
255
+ config=self.config,
256
+ extra_headers=self.extra_headers,
257
+ )
@@ -9,6 +9,55 @@ from functools import lru_cache as cache
9
9
  from . import TCMS
10
10
  from .version import __version__
11
11
 
12
+ _TEST_CASE_FIELDS_ATTRIBUTE = "__kiwitcms_TestCase_fields__"
13
+
14
+
15
+ class TestCase: # pylint: disable=too-few-public-methods
16
+ """
17
+ Decorator which attaches ``tcms.testcases.models.TestCase`` model
18
+ fields to a test function. Test suite authors can use it to tell
19
+ Python test runner plugins which test case a test function belongs
20
+ to::
21
+
22
+ from tcms_api.plugin_helpers import TestCase
23
+
24
+ @TestCase(id=45)
25
+ def test_coupon_guest():
26
+ ...
27
+
28
+ @TestCase(summary="Guest can apply a coupon at checkout")
29
+ def test_coupon_guest_v2():
30
+ ...
31
+
32
+ The keyword arguments are passed to ``TestCase.create()`` verbatim.
33
+
34
+ .. versionadded:: 17.3
35
+ """
36
+
37
+ def __init__(self, **fields):
38
+ self.fields = fields
39
+
40
+ def __call__(self, test_case):
41
+ setattr(test_case, _TEST_CASE_FIELDS_ATTRIBUTE, self.fields)
42
+ return test_case
43
+
44
+
45
+ def get_test_case_fields(test_case):
46
+ """
47
+ Return the ``tcms.testcases.models.TestCase`` model fields attached
48
+ by the :class:`TestCase` decorator.
49
+
50
+ :param test_case: decorated callable, dictionary of fields or ``None``
51
+ :type test_case: callable or dict or None
52
+ :return: field values or an empty dictionary
53
+ :rtype: dict
54
+ """
55
+ if test_case is None:
56
+ return {}
57
+ if isinstance(test_case, dict):
58
+ return test_case
59
+ return getattr(test_case, _TEST_CASE_FIELDS_ATTRIBUTE, {}) or {}
60
+
12
61
 
13
62
  # pylint: disable=too-many-instance-attributes, too-many-public-methods
14
63
  class Backend:
@@ -496,31 +545,50 @@ class Backend:
496
545
  },
497
546
  )
498
547
 
499
- def test_case_get_or_create(self, summary):
548
+ def test_case_get_or_create(self, summary=None, test_case_data=None):
500
549
  """
501
- Search for a TestCase with the specified `summary` and Product.
502
- If it doesn't exist in the database it will be created!
550
+ Search for a TestCase and return it, creating a new one when it
551
+ doesn't exist in the database!
503
552
 
504
553
  .. important::
505
554
 
506
555
  Test runner plugins **must** call this method!
507
556
 
557
+ The optional ``test_case_data`` argument may be a callable decorated
558
+ with :class:`TestCase` or a dictionary of TestCase model fields.
559
+
508
560
  :param summary: A TestCase summary
509
561
  :type summary: str
562
+ :param test_case_data: Decorated callable or TestCase model fields
563
+ :type test_case_data: callable or dict
510
564
  :return: Serialized ``tcms.testcase.models.TestCase`` and boolean
511
565
  flag to indicate if the TestCase has just been created!
512
566
  :rtype: (dict, bool)
513
567
  """
568
+ fields = dict(get_test_case_fields(test_case_data))
569
+
570
+ # a summary supplied by the decorator is authoritative
571
+ summary = fields.get("summary", summary)
514
572
  summary = summary[:255]
515
573
  created = False
516
- test_case = self.rpc.TestCase.filter(
517
- {
574
+
575
+ # anything inside the decorator is an explicit decision by the
576
+ # user and is the canonical identifier; fall back to the automatic
577
+ # summary + product lookup only when the decorator has no fields
578
+ query = dict(fields)
579
+ query.pop("category__product", None)
580
+ if not query:
581
+ query = {
518
582
  "summary": summary,
519
583
  "category__product": self.product_id,
520
584
  }
521
- )
522
585
 
586
+ test_case = self.rpc.TestCase.filter(query)
523
587
  if not test_case:
588
+ # `id` and `pk` are not model fields accepted by TestCase.create()
589
+ fields.pop("id", None)
590
+ fields.pop("pk", None)
591
+
524
592
  test_case = [
525
593
  self.rpc.TestCase.create(
526
594
  {
@@ -530,6 +598,7 @@ class Backend:
530
598
  "case_status": self.confirmed_id,
531
599
  "notes": self.created_by_text,
532
600
  "is_automated": True,
601
+ **fields,
533
602
  }
534
603
  )
535
604
  ]
@@ -575,7 +644,7 @@ class Backend:
575
644
  result = [result]
576
645
  return result
577
646
 
578
- # pylint: disable=too-many-arguments
647
+ # pylint: disable=too-many-arguments,too-many-positional-arguments
579
648
  def update_test_execution(
580
649
  self,
581
650
  test_execution_id,
@@ -0,0 +1 @@
1
+ __version__ = "17.3"
@@ -0,0 +1,100 @@
1
+ # pylint: disable=protected-access,too-few-public-methods
2
+
3
+ import sys
4
+
5
+ from typing import Optional
6
+ from xmlrpc.client import _Method, SafeTransport, Transport, ServerProxy
7
+
8
+ from tcms_api.version import __version__
9
+
10
+ VERBOSE = 0
11
+ _PYTHON_VERSION = sys.version.replace("\n", "")
12
+
13
+
14
+ class TCMSProxy(ServerProxy):
15
+ def __request(self, methodname, params):
16
+ self._ServerProxy__transport._extra_headers = [
17
+ ("Referer", f"{methodname}@{self._ServerProxy__host}")
18
+ ]
19
+ return self._ServerProxy__request(methodname, params)
20
+
21
+ def __getattr__(self, name):
22
+ return _Method(self.__request, name)
23
+
24
+
25
+ class CookieTransport(Transport):
26
+ """A subclass of xmlrpc.client.Transport that supports cookies."""
27
+
28
+ scheme = "http"
29
+ user_agent = f"tcms-api/{__version__}/Python {_PYTHON_VERSION}"
30
+
31
+ def __init__(self, *args, **kwargs):
32
+ super().__init__(*args, **kwargs)
33
+ self._cookies = []
34
+
35
+ def send_headers(self, connection, headers):
36
+ if self._cookies:
37
+ connection.putheader("Cookie", "; ".join(self._cookies))
38
+ super().send_headers(connection, headers)
39
+
40
+ def parse_response(self, response):
41
+ for header in response.msg.get_all("Set-Cookie", []):
42
+ cookie = header.split(";", 1)[0]
43
+ self._cookies.append(cookie)
44
+ return super().parse_response(response)
45
+
46
+
47
+ class SafeCookieTransport(SafeTransport, CookieTransport):
48
+ """SafeTransport subclass that supports cookies."""
49
+
50
+ scheme = "https"
51
+
52
+
53
+ class TCMSXmlrpc:
54
+ """
55
+ XML-RPC client for username/password or bearer token authentication.
56
+ """
57
+
58
+ session_cookie_name = "sessionid"
59
+ transport = None
60
+
61
+ def __init__(
62
+ self,
63
+ username,
64
+ password,
65
+ url,
66
+ extra_headers: Optional[dict[str, str]] = None,
67
+ ):
68
+ has_authorization = any(
69
+ header.lower() == "authorization" for header in (extra_headers or {})
70
+ )
71
+ headers = list((extra_headers or {}).items())
72
+
73
+ if has_authorization and not url.startswith("https://"):
74
+ raise RuntimeError(
75
+ f"https:// required for token authentication. URL provided: {url}"
76
+ )
77
+ if self.transport is None:
78
+ if url.startswith("https://"):
79
+ self.transport = SafeCookieTransport(headers=headers)
80
+ elif url.startswith("http://"):
81
+ self.transport = CookieTransport(headers=headers)
82
+ else:
83
+ raise RuntimeError("Unrecognized URL scheme")
84
+
85
+ self.server = TCMSProxy(
86
+ url, transport=self.transport, verbose=VERBOSE, allow_none=1
87
+ )
88
+
89
+ self.username = username
90
+ self.password = password
91
+ self.url = url
92
+
93
+ if not has_authorization:
94
+ self.login()
95
+
96
+ def login(self):
97
+ """
98
+ Login in the web app to save a session cookie in the cookie jar!
99
+ """
100
+ self.server.Auth.login(self.username, self.password)