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

@@ -21,6 +21,8 @@
Test the `ipalib.frontend` module.
"""
# FIXME: Pylint errors
# pylint: disable=no-member
import pytest
import six
@@ -69,7 +71,7 @@ def test_is_rule():
is_rule = frontend.is_rule
flag = frontend.RULE_FLAG
class no_call:
class no_call(object):
def __init__(self, value):
if value is not None:
assert value in (True, False)
@@ -197,7 +199,7 @@ class test_Command(ClassChecker):
"""
Return a standard subclass of `ipalib.frontend.Command`.
"""
class Rule:
class Rule(object):
def __init__(self, name):
self.name = name
@@ -230,7 +232,7 @@ class test_Command(ClassChecker):
"""
Helper method used to test args and options.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -276,7 +278,7 @@ class test_Command(ClassChecker):
"""
Test the ``ipalib.frontend.Command.args`` instance attribute.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -333,7 +335,7 @@ class test_Command(ClassChecker):
"""
Test the ``ipalib.frontend.Command.options`` instance attribute.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -357,7 +359,7 @@ class test_Command(ClassChecker):
"""
Test the ``ipalib.frontend.Command.output`` instance attribute.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -405,7 +407,7 @@ class test_Command(ClassChecker):
"""
Test the `ipalib.frontend.Command.convert` method.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -422,7 +424,7 @@ class test_Command(ClassChecker):
"""
Test the `ipalib.frontend.Command.normalize` method.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -470,7 +472,7 @@ class test_Command(ClassChecker):
"""
Test the `ipalib.frontend.Command.validate` method.
"""
class api:
class api(object):
env = config.Env(context='cli')
@staticmethod
def is_production_mode():
@@ -689,7 +691,7 @@ class test_Command(ClassChecker):
"""
Test the `ipalib.frontend.Command.validate_output` method.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -731,7 +733,7 @@ class test_Command(ClassChecker):
"""
Test `ipalib.frontend.Command.validate_output` per-type validation.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -760,7 +762,7 @@ class test_Command(ClassChecker):
"""
Test `ipalib.frontend.Command.validate_output` nested validation.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -795,7 +797,7 @@ class test_Command(ClassChecker):
"""
Test the `ipalib.frontend.Command.get_output_params` method.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -831,7 +833,7 @@ class test_LocalOrRemote(ClassChecker):
"""
Test the `ipalib.frontend.LocalOrRemote.__init__` method.
"""
class api:
class api(object):
@staticmethod
def is_production_mode():
return False
@@ -914,7 +916,7 @@ class test_Object(ClassChecker):
Test the `ipalib.frontend.Object.__init__` method.
"""
# Setup for test:
class DummyAttribute:
class DummyAttribute(object):
def __init__(self, obj_name, attr_name, name=None):
self.obj_name = obj_name
self.attr_name = attr_name
@@ -942,7 +944,7 @@ class test_Object(ClassChecker):
cnt = 10
methods_format = 'method_%d'
class FakeAPI:
class FakeAPI(object):
def __init__(self):
self._API__plugins = get_attributes(cnt, methods_format)
self._API__default_map = {}
@@ -1111,16 +1113,13 @@ class test_Attribute(ClassChecker):
Test the `ipalib.frontend.Attribute.__init__` method.
"""
user_obj = 'The user frontend.Object instance'
class api:
class api(object):
Object = {("user", "1"): user_obj}
@staticmethod
def is_production_mode():
return False
class user_add(self.cls):
pass
o = user_add(api)
assert read_only(o, 'api') is api
assert read_only(o, 'obj') is user_obj