2014-10-21 07:09:11 +02:00
|
|
|
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
|
|
|
|
#
|
|
|
|
# This file is part of Ansible
|
|
|
|
#
|
|
|
|
# Ansible is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Ansible is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
# Make coding more python3-ish
|
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
|
|
|
|
'''
|
|
|
|
Compat module for Python2.7's unittest module
|
|
|
|
'''
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
Remove wildcard imports
Made the following changes:
* Removed wildcard imports
* Replaced long form of GPL header with short form
* Removed get_exception usage
* Added from __future__ boilerplate
* Adjust division operator to // where necessary
For the following files:
* web_infrastructure modules
* system modules
* linode, lxc, lxd, atomic, cloudscale, dimensiondata, ovh, packet,
profitbricks, pubnub, smartos, softlayer, univention modules
* compat dirs (disabled as its used intentionally)
2017-07-28 07:55:24 +02:00
|
|
|
# Allow wildcard import because we really do want to import all of
|
|
|
|
# unittests's symbols into this compat shim
|
2018-02-07 00:17:49 +01:00
|
|
|
# pylint: disable=wildcard-import,unused-wildcard-import
|
2014-10-21 07:09:11 +02:00
|
|
|
if sys.version_info < (2, 7):
|
|
|
|
try:
|
|
|
|
# Need unittest2 on python2.6
|
|
|
|
from unittest2 import *
|
|
|
|
except ImportError:
|
|
|
|
print('You need unittest2 installed on python2.6.x to run tests')
|
|
|
|
else:
|
|
|
|
from unittest import *
|