Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable/train] unit tests asserts need fixing as then break in unit tests #644

Open
ajkavanagh opened this issue Jan 19, 2024 · 0 comments

Comments

@ajkavanagh
Copy link
Collaborator

Note this is on the stable/train branch.

See the following:

======================================================================
ERROR: test_series_upgrade (unit_tests.utilities.test_zaza_utilities_generic.TestGenericUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/zaza/zaza/unit_tests/utilities/test_zaza_utilities_generic.py", line [24](https://github.com/openstack-charmers/zaza/actions/runs/7213515614/job/19653554428?pr=637#step:6:25)6, in test_series_upgrade
    self.block_until_all_units_idle.called_with()
  File "/home/runner/work/zaza/zaza/.tox/py/lib/python3.8/site-packages/mock/mock.py", line 695, in __getattr__
    raise AttributeError(
AttributeError: 'called_with' is not a valid assertion. Use a spec for the mock if 'called_with' is meant to be an attribute.

======================================================================
ERROR: test_block_until_auto_reconnect_model_disconnected_async (unit_tests.test_zaza_model.TestModel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/zaza/zaza/unit_tests/test_zaza_model.py", line 453, in test_block_until_auto_reconnect_model_disconnected_async
    self.Model_mock.connect_model.has_calls([mock.call('modelname'),
  File "/home/runner/work/zaza/zaza/.tox/py/lib/python3.8/site-packages/mock/mock.py", line 695, in __getattr__
    raise AttributeError(
AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.

======================================================================
ERROR: test_block_until_auto_reconnect_model_disconnected_sync (unit_tests.test_zaza_model.TestModel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/zaza/zaza/unit_tests/test_zaza_model.py", line 438, in test_block_until_auto_reconnect_model_disconnected_sync
    self.Model_mock.connect_model.has_calls([mock.call('modelname'),
  File "/home/runner/work/zaza/zaza/.tox/py/lib/python3.8/site-packages/mock/mock.py", line 695, in __getattr__
    raise AttributeError(
AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.

Essentially, just update the asserts to be correct.

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

No branches or pull requests

1 participant