Mock datetime instead of redefining standard library
This fixes up the test to mock the datetime calls specifically in
the test that needs to mock them, rather than the prior approach
which was redefining the behavior of the standard library function
globally.
This change also pins openstacksdk to fix python 3.6 unit tests.
Commit b34de32a in openstacksdk replaced the appdirs library with
the platformdirs library. The platformdirs library is not python 3.6
compatible and causes some challenges. Pin the openstacksdk to a
lower version. Thanks to Billy Olsen for this patch. Taken from: https://review.opendev.org/c/openstack/charm-neutron-api/+/902607
Closes-Bug: #2045588
Change-Id: I9c585c91c5527a61e4a8dbcba0a8a01108cd9b2e
(cherry picked from commit 72e22a94ed4966ff6fb2fba41bac1b204dbd4c14)
Reviewed: https:/ /review. opendev. org/c/openstack /charm- swift-storage/ +/902664 /opendev. org/openstack/ charm-swift- storage/ commit/ 9671fa85e06c957 2111246151f459b 2b0624a34f
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/xena
commit 9671fa85e06c957 2111246151f459b 2b0624a34f
Author: Corey Bryant <email address hidden>
Date: Mon Dec 4 15:47:20 2023 -0500
Mock datetime instead of redefining standard library
This fixes up the test to mock the datetime calls specifically in
the test that needs to mock them, rather than the prior approach
which was redefining the behavior of the standard library function
globally.
This change also pins openstacksdk to fix python 3.6 unit tests. /review. opendev. org/c/openstack /charm- neutron- api/+/902607
Commit b34de32a in openstacksdk replaced the appdirs library with
the platformdirs library. The platformdirs library is not python 3.6
compatible and causes some challenges. Pin the openstacksdk to a
lower version. Thanks to Billy Olsen for this patch. Taken from:
https:/
Closes-Bug: #2045588 61e4a8dbcba0a8a 01108cd9b2e f6fb2fba41bac1b 204dbd4c14)
Change-Id: I9c585c91c5527a
(cherry picked from commit 72e22a94ed4966f