Skip to content

Conversation

@hishamanver
Copy link

What

  • Two updates to fix unit tests:
  • Also have whitespace cleanup, I can remove these if its unacceptable. I just have it enabled by default in my editor

Why

  • missing transport type definition in unittests
  • fixed a string comparison for padding unset test

Verification

Before

python3 -m unittest tests/*.py
..................................................................................................................................................................................F......................................................E....................................................EEEEEEEEEEEEEEEEEE...................................................................................................................................................................................
======================================================================
ERROR: test_diameter_message__update_avps_method__1 (tests.test_base.TestDiameterMessage)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_base.py", line 1869, in test_diameter_message__update_avps_method__1
    connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__custom_cea (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__custom_cer (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__custom_dpa (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__custom_dpr (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__custom_dwa (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__custom_dwr (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_custom_messages__no_list (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__diameter_base_proxy__get_default_messages (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_cea (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_cer (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_dpa (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_dpr (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_dwa (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_dwr (tests.test_proxy.TestDiameterBaseProxy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 49, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_cea (tests.test_proxy.TestDiameterBaseProxyWithOneApplicationId)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 3348, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_cer (tests.test_proxy.TestDiameterBaseProxyWithOneApplicationId)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 3348, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_cea (tests.test_proxy.TestDiameterBaseProxyWithTwoApplicationsId)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 3611, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
ERROR: test__load_cer (tests.test_proxy.TestDiameterBaseProxyWithTwoApplicationsId)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_proxy.py", line 3611, in setUp
    self.connection = _convert_config_to_connection_obj(config)
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/bromelia/_internal_utils.py", line 264, in _convert_config_to_connection_obj
    transport_type=transport_type,
UnboundLocalError: local variable 'transport_type' referenced before assignment

======================================================================
FAIL: test_diameter_avp__custom_object__padding_not_allowed_to_set (tests.test_base.TestDiameterAVP)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/hisham/5gc/zzzzzzdocker/bromelia/tests/test_base.py", line 532, in test_diameter_avp__custom_object__padding_not_allowed_to_set
    self.assertEqual(cm.exception.args[0], "can't set attribute")
AssertionError: "can't set attribute 'padding'" != "can't set attribute"
- can't set attribute 'padding'
?                    ----------
+ can't set attribute


----------------------------------------------------------------------
Ran 483 tests in 84.323s

FAILED (failures=1, errors=19)

After

python3 -m unittest tests/*.py
................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 483 tests in 84.375s

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant