mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
41
python/mock-1.0.0/tests/support.py
Normal file
41
python/mock-1.0.0/tests/support.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import sys
|
||||
|
||||
info = sys.version_info
|
||||
if info[:3] >= (3, 2, 0):
|
||||
# for Python 3.2 ordinary unittest is fine
|
||||
import unittest as unittest2
|
||||
else:
|
||||
import unittest2
|
||||
|
||||
|
||||
try:
|
||||
callable = callable
|
||||
except NameError:
|
||||
def callable(obj):
|
||||
return hasattr(obj, '__call__')
|
||||
|
||||
|
||||
inPy3k = sys.version_info[0] == 3
|
||||
with_available = sys.version_info[:2] >= (2, 5)
|
||||
|
||||
|
||||
def is_instance(obj, klass):
|
||||
"""Version of is_instance that doesn't access __class__"""
|
||||
return issubclass(type(obj), klass)
|
||||
|
||||
|
||||
class SomeClass(object):
|
||||
class_attribute = None
|
||||
|
||||
def wibble(self):
|
||||
pass
|
||||
|
||||
|
||||
class X(object):
|
||||
pass
|
||||
|
||||
try:
|
||||
next = next
|
||||
except NameError:
|
||||
def next(obj):
|
||||
return obj.next()
|
||||
Loading…
Add table
Add a link
Reference in a new issue