Unit test failure with Python 3.10

Bug #1988559 reported by Thomas Goirand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-tackerclient
New
Undecided
Unassigned

Bug Description

Hi,

Building python-tackerclient 1.12.0 with Python 3.10 (in Debian Unstable) results with some unit test failures as per below:

======================================================================
FAIL: tackerclient.tests.unit.osc.v1.test_vnflcm.TestListVnfLcm.test_take_action_with_pagination
tackerclient.tests.unit.osc.v1.test_vnflcm.TestListVnfLcm.test_take_action_with_pagination
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tackerclient/client.py", line 98, in _cs_request
    resp, body = self.request(*args, **kargs)
  File "/<<PKGBUILDDIR>>/tackerclient/client.py", line 139, in request
    resp = requests.request(
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests_mock/mocker.py", line 144, in _fake_send
    return _original_send(session, request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests_mock/adapter.py", line 248, in send
    resp = matcher(request)
  File "/usr/lib/python3/dist-packages/requests_mock/adapter.py", line 228, in __call__
    return response_matcher.get_response(request)
  File "/usr/lib/python3/dist-packages/requests_mock/response.py", line 259, in get_response
    return create_response(request,
  File "/usr/lib/python3/dist-packages/requests_mock/response.py", line 171, in create_response
    text = jsonutils.dumps(json)
  File "/usr/lib/python3.10/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type FormatComplexDataColumn is not JSON serializable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tackerclient/tests/unit/osc/v1/test_vnflcm.py", line 214, in test_take_action_with_pagination
    actual_columns, data = self.list_vnf_instance.take_action(parsed_args)
  File "/<<PKGBUILDDIR>>/tackerclient/osc/v1/vnflcm/vnflcm.py", line 178, in take_action
    vnf_instances = client.list_vnf_instances(**_params)
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 1407, in list_vnf_instances
    return self.vnf_lcm_client.list_vnf_instances(
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 124, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 936, in list_vnf_instances
    vnf_instances = self.list(None, self.vnf_instances_path,
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 382, in list
    for r in self._pagination(collection, path, headers, **params):
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 399, in _pagination
    res = self.get(path, headers=headers, params=params)
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 362, in get
    return self.retry_request("GET", action, body=body,
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 339, in retry_request
    return self.do_request(method, action, body=body,
  File "/<<PKGBUILDDIR>>/tackerclient/v1_0/client.py", line 239, in do_request
    resp, replybody = self.httpclient.do_request(
  File "/<<PKGBUILDDIR>>/tackerclient/client.py", line 172, in do_request
    resp, body = self._cs_request(self.endpoint_url + url, method,
  File "/<<PKGBUILDDIR>>/tackerclient/client.py", line 106, in _cs_request
    raise exceptions.ConnectionFailed(reason=e)
tackerclient.common.exceptions.ConnectionFailed: Connection to tacker failed: Object of type FormatComplexDataColumn is not JSON serializable

======================================================================
FAIL: tackerclient.tests.unit.osc.v1.test_vnflcm_subsc.TestListLccnSubscription.test_take_action_with_pagination
tackerclient.tests.unit.osc.v1.test_vnflcm_subsc.TestListLccnSubscription.test_take_action_with_pagination
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/tackerclient/tests/unit/osc/v1/test_vnflcm_subsc.py", line 139, in test_take_action_with_pagination
    expected_data.append(vnflcm_subsc_fakes.get_subscription_data(
  File "/<<PKGBUILDDIR>>/tackerclient/tests/unit/osc/v1/vnflcm_subsc_fakes.py", line 166, in get_subscription_data
    subscription.pop(item)
KeyError: 'filter'

Please solve this asap (preferably before the release of Zed).

Cheers,

Thomas Goirand

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.