Imported Debian patch 4.7.2-3

This commit is contained in:
Timo Aaltonen
2019-05-06 08:43:34 +03:00
committed by Mario Fetka
parent 27edeba051
commit 8bc559c5a1
917 changed files with 1068993 additions and 1184676 deletions

View File

@@ -31,11 +31,12 @@ import re
import sys
from decimal import Decimal
from inspect import isclass
from xmlrpc.client import MAXINT, MININT
import pytest
import six
# pylint: disable=import-error
from six.moves.xmlrpc_client import MAXINT, MININT
# pylint: enable=import-error
from cryptography import x509 as crypto_x509
from cryptography.hazmat.backends import default_backend
@@ -172,7 +173,7 @@ def test_parse_param_spec():
assert str(e) == TYPE_ERROR % ('spec', str, bad_value, type(bad_value))
class DummyRule:
class DummyRule(object):
def __init__(self, error=None):
assert error is None or type(error) is unicode
self.error = error
@@ -580,7 +581,7 @@ class test_Param(ClassChecker):
"""
Test the `ipalib.parameters.Param.get_default` method.
"""
class PassThrough:
class PassThrough(object):
value = None
def __call__(self, value):
@@ -680,7 +681,7 @@ class test_Data(ClassChecker):
Test the `ipalib.parameters.Data.__init__` method.
"""
o = self.cls('my_data')
assert o.type is type(None) # noqa
assert o.type is type(None)
assert o.password is False
assert o.rules == tuple()
assert o.class_rules == tuple()
@@ -1221,7 +1222,7 @@ class test_Number(ClassChecker):
Test the `ipalib.parameters.Number.__init__` method.
"""
o = self.cls('my_number')
assert o.type is type(None) # noqa
assert o.type is type(None)
assert o.password is False
assert o.rules == tuple()
assert o.class_rules == tuple()
@@ -1242,7 +1243,7 @@ class test_Int(ClassChecker):
# Test with no kwargs:
o = self.cls('my_number')
assert o.type == int
assert o.allowed_types == (int,)
assert o.allowed_types == six.integer_types
assert isinstance(o, parameters.Int)
assert o.minvalue == int(MININT)
assert o.maxvalue == int(MAXINT)