charm-cinder/unit_tests
Trent Lloyd 97d5773977 Fix missing assert_ prefix on called_with
test_clean_storage_unmount incorrectly used 'called_with' instead of
'assert_called_with' which just made a mock function call and didn't
check or assert that the function was actually called.

As a result this function didn't actually test anything, the expected
parameters were not correct so they have been updated.

An error to catch this accidental mistake was added in the recently
released mock 5.0.1 (https://github.com/python/cpython/issues/100690)
  AttributeError: 'called_with' is not a valid assertion.
  Use a spec for the mock if 'called_with' is meant to be an attribute.

The mock library ships in python as unittest.mock but also publishes the
latest code as the 'mock' python package so that older python versions
can get the latest code. The stable branches currently install mock
but the master branch does not, so this error does not actually appear
on master but only the <=yoga stable branches currently. The test is
however wrong either way.

Change-Id: I3076778e8fc62c086651d29abb2c5a3d9921be97
2023-02-03 10:46:04 +08:00
..
__init__.py Use unittest.mock instead of mock 2021-12-15 10:56:43 +00:00
test_actions_cinder_manage.py Check if the newhost exists instead of currenthost 2022-04-25 16:22:53 +08:00
test_actions_openstack_upgrade.py Use unittest.mock instead of mock 2021-12-15 10:56:43 +00:00
test_actions.py Use unittest.mock instead of mock 2021-12-15 10:56:43 +00:00
test_cinder_contexts.py Add support to configure scheduler_default_filters 2022-01-25 11:04:40 +10:30
test_cinder_hooks.py Add identity-credentials relation support 2023-01-25 11:25:22 +08:00
test_cinder_utils.py Fix missing assert_ prefix on called_with 2023-02-03 10:46:04 +08:00
test_cluster_hooks.py Use unittest.mock instead of mock 2021-12-15 10:56:43 +00:00
test_utils.py Use unittest.mock instead of mock 2021-12-15 10:56:43 +00:00