From c10a7dfd10f3a37dd9e218e480291024df3fe1a3 Mon Sep 17 00:00:00 2001 From: Ruby Loo Date: Mon, 27 Feb 2017 15:45:03 +0000 Subject: [PATCH] Fix BaseBaremetalTest._assertExpected docstring This updates the docstring for tempest plugin's BaseBaremetalTest._assertExpected() so that it clarifies what it is doing and what the parameters are. Change-Id: Icd61bbbdc0f0633a93adef89652d54a87d835534 --- ironic_tempest_plugin/tests/api/admin/base.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ironic_tempest_plugin/tests/api/admin/base.py b/ironic_tempest_plugin/tests/api/admin/base.py index 0e3f59e2d5..cd15936845 100644 --- a/ironic_tempest_plugin/tests/api/admin/base.py +++ b/ironic_tempest_plugin/tests/api/admin/base.py @@ -119,7 +119,22 @@ class BaseBaremetalTest(api_version_utils.BaseMicroversionTest, super(BaseBaremetalTest, cls).resource_cleanup() def _assertExpected(self, expected, actual): - """Check if not expected keys/values exist in actual response body.""" + """Check if expected keys/values exist in actual response body. + + Check if the expected keys and values are in the actual response body. + It will not check the keys 'created_at' and 'updated_at', since they + will always have different values. Asserts if any expected key (or + corresponding value) is not in the actual response. + + Note: this method has an underscore even though it is used outside of + this class, in order to distinguish this method from the more standard + assertXYZ methods. + + :param expected: dict of key-value pairs that are expected to be in + 'actual' dict. + :param actual: dict of key-value pairs. + + """ for key, value in expected.items(): if key not in ('created_at', 'updated_at'): self.assertIn(key, actual)