commit 1e0570b2a598b43a85faa28e07ab97d56bf5ba5e
Author: John L. Villalovos <email address hidden>
Date: Mon Feb 5 22:29:38 2018 -0800
Fix breaking unit tests due to iso8601 changes
The move from iso8601===0.1.11 to iso8601===0.1.12 broke unit
tests in oslo.utils.
iso8601 used to do:
from datetime import datetime
But now they call datetime.datetime():
import datetime datetime.datetime()
Unfortunately the unit tests that mocked datetime.datetime() are now
mocking the one in iso8601. This causes a failure in the unit tests.
Fix this by using the 'wraps' argument to mock. So that the calls will
get passed through to datetime.datetime. Also changed to using the
decorator style of mock.
In addition Python 3 unit tests were broken due to changing how the
UTC time zone is represented from 'UTC' to 'UTC+00:00'.
Reviewed: https:/ /review. openstack. org/541543 /git.openstack. org/cgit/ openstack/ oslo.utils/ commit/ ?id=1e0570b2a59 8b43a85faa28e07 ab97d56bf5ba5e
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 1e0570b2a598b43 a85faa28e07ab97 d56bf5ba5e
Author: John L. Villalovos <email address hidden>
Date: Mon Feb 5 22:29:38 2018 -0800
Fix breaking unit tests due to iso8601 changes
The move from iso8601===0.1.11 to iso8601===0.1.12 broke unit
tests in oslo.utils.
iso8601 used to do:
from datetime import datetime
But now they call datetime. datetime( ):
datetime. datetime( )
import datetime
Unfortunately the unit tests that mocked datetime.datetime() are now
mocking the one in iso8601. This causes a failure in the unit tests.
Fix this by using the 'wraps' argument to mock. So that the calls will
get passed through to datetime.datetime. Also changed to using the
decorator style of mock.
In addition Python 3 unit tests were broken due to changing how the
UTC time zone is represented from 'UTC' to 'UTC+00:00'.
Closes-Bug: #1747575 366bef2bc1a32c4 57a3c16843d 40b57dbc450f80e 6c0c0f6e43)
Closes-Bug: #1744160
Change-Id: Ia80ffb5e571cc5
(cherry picked from commit 010fe3b10238717