Public bug reported:

The manual mock count reset doesn't work since python 3.13

=================================== FAILURES ===================================
_ 
OpenStackIdentityConnectionTestCase.test_token_expiration_and_force_reauthentication
 _

self =
<libcloud.test.common.test_openstack_identity.OpenStackIdentityConnectionTestCase
testMethod=test_token_expiration_and_force_reauthentication>

    def test_token_expiration_and_force_reauthentication(self):
        user_id = OPENSTACK_PARAMS[0]
        key = OPENSTACK_PARAMS[1]

        connection = self._get_mock_connection(OpenStack_2_0_MockHttp)
        auth_url = connection.auth_url

        osa = OpenStackIdentity_2_0_Connection(
            auth_url=auth_url, user_id=user_id, key=key, parent_conn=connection
        )

        mocked_auth_method = Mock(wraps=osa._authenticate_2_0_with_body)
        osa._authenticate_2_0_with_body = mocked_auth_method

        # Force re-auth, expired token
        osa.auth_token = None
        osa.auth_token_expires = YESTERDAY
        count = 5

        for i in range(0, count):
            osa.authenticate(force=True)

        self.assertEqual(mocked_auth_method.call_count, count)

        # No force reauth, expired token
        osa.auth_token = None
        osa.auth_token_expires = YESTERDAY

        mocked_auth_method.call_count = 0
        self.assertEqual(mocked_auth_method.call_count, 0)

        for i in range(0, count):
            osa.authenticate(force=False)

>       self.assertEqual(mocked_auth_method.call_count, 1)
E       AssertionError: 6 != 1

libcloud/test/common/test_openstack_identity.py:244: AssertionError

** Affects: libcloud (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: update-excuse

** Tags added: update-excuse

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2142760

Title:
  FTBFS libcloud (3.8.0+repack-5) resolute

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libcloud/+bug/2142760/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to