]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: change tests to assert using mock call not func.args
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 1 Jun 2023 15:16:13 +0000 (11:16 -0400)
committerAdam King <adking@redhat.com>
Thu, 31 Aug 2023 17:35:13 +0000 (13:35 -0400)
commit4e57a530eb1b70131b6acaba02f7112af04ff1e7
tree9f199c7e8f20699aad9f1d08f0864e15f4d19ea4
parent7029278e4a3b1145f98d57fb47d1a30b2f148b46
cephadm: change tests to assert using mock call not func.args

The Python docs [1] note that:
  Changed in version 3.8: Added args and kwargs properties.

In order to run tests on python 3.6 (example: `tox -e py36`) we
change the tests to do the asserts using the older call(...)
comparison style, with mock.ANY used for args we don't care about.

[1] - https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.call_args

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/test_util_funcs.py