In the unit tests' setUp, it was setting self.mock_rbd = mock_rbd
(where mock_rbd is the argument passed by @mock.patch.object) and
setting all sorts of properties onto self.mock_rbd, but mock_rbd
would become invalid after setUp finished, as the mock.patch
decorator would remove the patched mock. The same applies with
mock_rados.
This patch addresses this issue by refactoring and simplifying the
unit tests.
Reviewed: https:/ /review. openstack. org/538022 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=9c7d6123e3e 66fd8b182af5482 73df9e7d66ee36
Committed: https:/
Submitter: Zuul
Branch: master
commit 9c7d6123e3e66fd 8b182af548273df 9e7d66ee36
Author: Claudiu Belu <email address hidden>
Date: Wed Jan 24 23:30:37 2018 -0800
tests: refactors and cleans up test_rbd.py
In the unit tests' setUp, it was setting self.mock_rbd = mock_rbd
(where mock_rbd is the argument passed by @mock.patch.object) and
setting all sorts of properties onto self.mock_rbd, but mock_rbd
would become invalid after setUp finished, as the mock.patch
decorator would remove the patched mock. The same applies with
mock_rados.
This patch addresses this issue by refactoring and simplifying the
unit tests.
Change-Id: Ie2bf4d559e5391 be3fe778835673a 11de7ec8e1b
Related-Bug: #1735588