Skip to content

Commit da7fdc3

Browse files
DrFobosKondratov, Aleksey
authored and
Kondratov, Aleksey
committed
Fix type annotation for gssapi.creds.Credentials name property. Add test checks.
Signed-off-by: Aleksey Kondratov <[email protected]>
1 parent ca046f4 commit da7fdc3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

gssapi/creds.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ def __new__(
8282
super(Credentials, cls).__new__(cls, base_creds))
8383

8484
@property
85-
def name(self) -> rnames.Name:
85+
def name(self) -> names.Name:
8686
"""Get the name associated with these credentials"""
87-
return t.cast(rnames.Name,
87+
return t.cast(names.Name,
8888
self.inquire(name=True, lifetime=False, usage=False,
8989
mechs=False).name)
9090

gssapi/tests/test_high_level.py

+2
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def test_inquire(self, str_name, kwargs):
224224

225225
if kwargs['name']:
226226
self.assertEqual(resp.name, self.name)
227+
self.assertIsInstance(resp.name, gssnames.Name)
227228
else:
228229
self.assertIsNone(resp.name)
229230

@@ -250,6 +251,7 @@ def test_inquire_by_mech(self, str_name, kwargs):
250251

251252
if kwargs['name']:
252253
self.assertEqual(resp.name, self.name)
254+
self.assertIsInstance(resp.name, gssnames.Name)
253255
else:
254256
self.assertIsNone(resp.name)
255257

0 commit comments

Comments
 (0)