tests: pre-scrub old HMAC keys before testing creation#467
Conversation
|
Note to reviewers: I created a key manually and, inside the testcase, hacked its |
7190682 to
bdbc765
Compare
|
|
||
| before_keys = set(Config.CLIENT.list_hmac_keys()) | ||
|
|
||
| now = datetime.datetime.utcnow().replace(tzinfo=_helpers.UTC) |
There was a problem hiding this comment.
With pytz in the standard library now, which includes a utc, is there any need to still use our own handrolled?
There was a problem hiding this comment.
$ python3.6
Python 3.6.10 (default, Apr 20 2021, 13:17:17)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pytz'
>>>See googleapis/python-api-core@61490f5 (part of googleapis/python-api-core#212), which uses datetime.timezone.utc.
GCS is still stuck supporting Python 2.7, however.
chrisrossi
left a comment
There was a problem hiding this comment.
LGTM. This feels like a think that should be a fixture, to me, but if it really only happens once, I guess it can go either way.
Avoids hitting 5-key-per-service-account quota. Closes #334.
Addresses review comment.
bdbc765 to
c07995d
Compare
|
@chrisrossi c07995d moves the pre-scrub logic to a helper method (these systests aren't pytest-fixtures-ified), so that any future systest which might create HMAC keys can reuse it. Opened #475 to track the need to refactor systests. |
Avoids hitting 5-key-per-service-account quota. Closes googleapis#334.
Avoids hitting 5-key-per-service-account quota. Closes googleapis#334.
Avoids hitting 5-key-per-service-account quota.
Closes #334.