Do not check the context object in ``TestMeteringPlugin``
Since [1], the admin context is not ``Context`` object created
but the new one created in ``ContextBase.elevated``. This method
copies the object itself (creating a new one), adds the "admin"
role (if not present) and returns this new object.
Because this method always returns a new object, it is not possible
to check the ``Context`` object used to make the function call, as
long as the test doesn't store the elevated context used in the call
(apart from the reference stored in the mock object).
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/880340 /opendev. org/openstack/ neutron/ commit/ 6efae0b110af0ea 6ee92a9ef774cd7 02db3b834e
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/2023.1
commit 6efae0b110af0ea 6ee92a9ef774cd7 02db3b834e
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Thu Apr 13 17:54:47 2023 +0200
Do not check the context object in ``TestMeteringP lugin``
Since [1], the admin context is not ``Context`` object created elevated` `. This method
but the new one created in ``ContextBase.
copies the object itself (creating a new one), adds the "admin"
role (if not present) and returns this new object.
Because this method always returns a new object, it is not possible
to check the ``Context`` object used to make the function call, as
long as the test doesn't store the elevated context used in the call
(apart from the reference stored in the mock object).
[1]https:/ /review. opendev. org/c/openstack /neutron- lib/+/880143
Closes-Bug: #2016144 41caa24ce1e38d1 bebd5db0a9b fdc4a604a98d4b2 3554c78dae)
Change-Id: I5d7eb736064288
(cherry picked from commit c7ef8249419ecbe