Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2008-10-08 00:41:59 +0400
committerYann Leboulanger <asterix@lagaule.org>2008-10-08 00:41:59 +0400
commit9d7c80d52265e7f77fb5b5ea9d987592c49faa30 (patch)
treee032281da07a0fc9ccc54ac6c24d151d29792f62 /test/lib
parent96dd7b8ba7dc10c300ed7c0c7d19998feb03dc36 (diff)
[thorstenp] replace has_key by key in dict. Fixes #4392
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/mock.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lib/mock.py b/test/lib/mock.py
index 02b94b511..5d6348b1a 100644
--- a/test/lib/mock.py
+++ b/test/lib/mock.py
@@ -87,7 +87,7 @@ class Mock:
if realClass:
self.realClassMethods = dict(inspect.getmembers(realClass, inspect.isroutine))
for retMethod in self.mockReturnValues.keys():
- if not self.realClassMethods.has_key(retMethod):
+ if retMethod not in self.realClassMethods:
raise MockInterfaceError("Return value supplied for method '%s' that was not in the original class" % retMethod)
self._setupSubclassMethodInterceptors()
@@ -118,7 +118,7 @@ class Mock:
"""
if self.realClassMethods == None:
return
- if not self.realClassMethods.has_key(name):
+ if name not in self.realClassMethods:
raise MockInterfaceError("Calling mock method '%s' that was not found in the original class" % name)
func = self.realClassMethods[name]
@@ -181,7 +181,7 @@ def _getNumPosSeenAndCheck(numPosCallParams, callKwParams, args, varkw):
for arg in args[:numPosCallParams]:
posSeen[arg] = True
for kwp in callKwParams:
- if posSeen.has_key(kwp):
+ if kwp in posSeen:
raise MockInterfaceError("%s appears as both a positional and named parameter." % kwp)
if kwp in args:
posSeen[kwp] = True
@@ -289,7 +289,7 @@ class MockCallable:
def _findFunc(cl, name):
""" Depth first search for a method with a given name. """
- if cl.__dict__.has_key(name):
+ if name in cl.__dict__:
return cl.__dict__[name]
for base in cl.__bases__:
func = _findFunc(base, name)