File: Make_tests_pass_in_2020.patch

package info (click to toggle)
python-keystoneauth1 3.10.0-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,860 kB
  • sloc: python: 16,336; xml: 285; makefile: 97
file content (72 lines) | stat: -rw-r--r-- 2,676 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Description: Make tests pass in 2020
 This issue was found while working on reproducible builds for openSUSE.
 .
 This solves it similar to change I73bde68be53afff4e8dff12d756b8381f34b2adb
 .
 Changed month to February to avoid races around new year.
Author: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Mon, 9 Sep 2019 21:00:14 +0200
Change-Id: I2a28f3f4eaabaa772df395f3f5d55b6fd78f8968
Origin: upstream, https://review.opendev.org/701419
Last-Update: 2020-02-10

diff --git a/keystoneauth1/tests/unit/identity/test_identity_v2.py b/keystoneauth1/tests/unit/identity/test_identity_v2.py
index 530b0468..d7b76b82 100644
--- a/keystoneauth1/tests/unit/identity/test_identity_v2.py
+++ b/keystoneauth1/tests/unit/identity/test_identity_v2.py
@@ -12,6 +12,7 @@
 
 import copy
 import json
+import time
 import uuid
 
 from keystoneauth1 import _utils as ksa_utils
@@ -84,7 +85,8 @@ def setUp(self):
         self.TEST_RESPONSE_DICT = {
             "access": {
                 "token": {
-                    "expires": "2020-01-01T00:00:10.000123Z",
+                    "expires": "%i-02-01T00:00:10.000123Z" %
+                    (1 + time.gmtime().tm_year),
                     "id": self.TEST_TOKEN,
                     "tenant": {
                         "id": self.TEST_TENANT_ID
diff --git a/keystoneauth1/tests/unit/identity/test_identity_v3.py b/keystoneauth1/tests/unit/identity/test_identity_v3.py
index e257e8f3..d928d4d0 100644
--- a/keystoneauth1/tests/unit/identity/test_identity_v3.py
+++ b/keystoneauth1/tests/unit/identity/test_identity_v3.py
@@ -12,6 +12,7 @@
 
 import copy
 import json
+import time
 import uuid
 
 from keystoneauth1 import _utils as ksa_utils
@@ -135,6 +136,7 @@ def setUp(self):
         self.TEST_DISCOVERY_RESPONSE = {
             'versions': {'values': [fixture.V3Discovery(self.TEST_URL)]}}
 
+        nextyear = 1 + time.gmtime().tm_year
         self.TEST_RESPONSE_DICT = {
             "token": {
                 "methods": [
@@ -142,7 +144,7 @@ def setUp(self):
                     "password"
                 ],
 
-                "expires_at": "2020-01-01T00:00:10.000123Z",
+                "expires_at": "%i-02-01T00:00:10.000123Z" % nextyear,
                 "project": {
                     "domain": {
                         "id": self.TEST_DOMAIN_ID,
@@ -195,7 +197,7 @@ def setUp(self):
                     "application_credential"
                 ],
 
-                "expires_at": "2020-01-01T00:00:10.000123Z",
+                "expires_at": "%i-02-01T00:00:10.000123Z" % nextyear,
                 "project": {
                     "domain": {
                         "id": self.TEST_DOMAIN_ID,