mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Silence W601 .has_key() is deprecated
Related: https://pagure.io/freeipa/issue/8306 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
@@ -701,7 +701,7 @@ class CIDict(dict):
|
||||
if six.PY2:
|
||||
def has_key(self, key):
|
||||
# pylint: disable=no-member
|
||||
return super(CIDict, self).has_key(key.lower())
|
||||
return super(CIDict, self).has_key(key.lower()) # noqa
|
||||
# pylint: enable=no-member
|
||||
|
||||
def get(self, key, failobj=None):
|
||||
|
||||
@@ -164,11 +164,11 @@ class TestCIDict:
|
||||
|
||||
@pytest.mark.skipif(not six.PY2, reason="Python 2 only")
|
||||
def test_haskey(self):
|
||||
assert self.cidict.has_key("KEY1")
|
||||
assert self.cidict.has_key("key2")
|
||||
assert self.cidict.has_key("key3")
|
||||
assert self.cidict.has_key("KEY1") # noqa
|
||||
assert self.cidict.has_key("key2") # noqa
|
||||
assert self.cidict.has_key("key3") # noqa
|
||||
|
||||
assert not self.cidict.has_key("Key4")
|
||||
assert not self.cidict.has_key("Key4") # noqa
|
||||
|
||||
def test_contains(self):
|
||||
assert "KEY1" in self.cidict
|
||||
|
||||
@@ -119,10 +119,10 @@ class test_keyring:
|
||||
See if a key is available
|
||||
"""
|
||||
kernel_keyring.add_key(TEST_KEY, TEST_VALUE)
|
||||
assert kernel_keyring.has_key(TEST_KEY)
|
||||
assert kernel_keyring.has_key(TEST_KEY) # noqa
|
||||
|
||||
kernel_keyring.del_key(TEST_KEY)
|
||||
assert not kernel_keyring.has_key(TEST_KEY)
|
||||
assert not kernel_keyring.has_key(TEST_KEY) # noqa
|
||||
|
||||
def test_07(self):
|
||||
"""
|
||||
|
||||
@@ -249,9 +249,9 @@ class test_LDAPEntry:
|
||||
@pytest.mark.skipif(sys.version_info >= (3, 0), reason="Python 2 only")
|
||||
def test_has_key(self):
|
||||
e = self.entry
|
||||
assert not e.has_key('xyz')
|
||||
assert e.has_key('cn')
|
||||
assert e.has_key('COMMONNAME')
|
||||
assert not e.has_key('xyz') # noqa
|
||||
assert e.has_key('cn') # noqa
|
||||
assert e.has_key('COMMONNAME') # noqa
|
||||
|
||||
def test_in(self):
|
||||
e = self.entry
|
||||
|
||||
Reference in New Issue
Block a user