|
1 | | -import collections |
2 | 1 | import copy |
3 | 2 | import os |
4 | 3 | import socket |
5 | 4 | import unittest |
6 | 5 |
|
| 6 | +import six |
7 | 7 | import should_be.all # noqa |
8 | 8 |
|
9 | 9 | import gssapi.raw as gb |
10 | 10 | import gssapi.raw.misc as gbmisc |
11 | 11 | import k5test.unit as ktu |
12 | 12 | import k5test as kt |
13 | 13 |
|
| 14 | +if six.PY2: |
| 15 | + from collections import Set |
| 16 | +else: |
| 17 | + from collections.abc import Set |
| 18 | + |
14 | 19 |
|
15 | 20 | TARGET_SERVICE_NAME = b'host' |
16 | 21 | FQDN = socket.getfqdn().encode('utf-8') |
@@ -355,7 +360,7 @@ def test_inquire_context(self): |
355 | 360 | mech_type.should_be(gb.MechType.kerberos) |
356 | 361 |
|
357 | 362 | flags.shouldnt_be_none() |
358 | | - flags.should_be_a(collections.Set) |
| 363 | + flags.should_be_a(Set) |
359 | 364 | flags.shouldnt_be_empty() |
360 | 365 |
|
361 | 366 | local_est.should_be_a(bool) |
@@ -1084,7 +1089,7 @@ def test_basic_init_default_ctx(self): |
1084 | 1089 |
|
1085 | 1090 | out_mech_type.should_be(gb.MechType.kerberos) |
1086 | 1091 |
|
1087 | | - out_req_flags.should_be_a(collections.Set) |
| 1092 | + out_req_flags.should_be_a(Set) |
1088 | 1093 | out_req_flags.should_be_at_least_length(2) |
1089 | 1094 |
|
1090 | 1095 | out_token.shouldnt_be_empty() |
@@ -1139,7 +1144,7 @@ def test_basic_accept_context_no_acceptor_creds(self): |
1139 | 1144 |
|
1140 | 1145 | out_token.shouldnt_be_empty() |
1141 | 1146 |
|
1142 | | - out_req_flags.should_be_a(collections.Set) |
| 1147 | + out_req_flags.should_be_a(Set) |
1143 | 1148 | out_req_flags.should_be_at_least_length(2) |
1144 | 1149 |
|
1145 | 1150 | out_ttl.should_be_greater_than(0) |
@@ -1167,7 +1172,7 @@ def test_basic_accept_context(self): |
1167 | 1172 |
|
1168 | 1173 | out_token.shouldnt_be_empty() |
1169 | 1174 |
|
1170 | | - out_req_flags.should_be_a(collections.Set) |
| 1175 | + out_req_flags.should_be_a(Set) |
1171 | 1176 | out_req_flags.should_be_at_least_length(2) |
1172 | 1177 |
|
1173 | 1178 | out_ttl.should_be_greater_than(0) |
|
0 commit comments