Fix bad identation

Fix identation
This commit is contained in:
stepshal
2016-06-15 17:25:25 +07:00
parent 62920e53f1
commit fda1268077
11 changed files with 31 additions and 31 deletions

View File

@@ -18,14 +18,14 @@ def with_metaclass(meta, *bases):
class _ObjectProxyMethods(object):
# We use properties to override the values of __module__ and
# __doc__. If we add these in ObjectProxy, the derived class
# __dict__ will still be setup to have string variants of these
# attributes and the rules of descriptors means that they appear to
# take precedence over the properties in the base class. To avoid
# that, we copy the properties into the derived class type itself
# via a meta class. In that way the properties will always take
# precedence.
# We use properties to override the values of __module__ and
# __doc__. If we add these in ObjectProxy, the derived class
# __dict__ will still be setup to have string variants of these
# attributes and the rules of descriptors means that they appear to
# take precedence over the properties in the base class. To avoid
# that, we copy the properties into the derived class type itself
# via a meta class. In that way the properties will always take
# precedence.
@property
def __module__(self):
@@ -61,10 +61,10 @@ class _ObjectProxyMethods(object):
class _ObjectProxyMetaType(type):
def __new__(cls, name, bases, dictionary):
# Copy our special properties into the class so that they
# always take precedence over attributes of the same name added
# during construction of a derived class. This is to save
# duplicating the implementation for them in all derived classes.
# Copy our special properties into the class so that they
# always take precedence over attributes of the same name added
# during construction of a derived class. This is to save
# duplicating the implementation for them in all derived classes.
dictionary.update(vars(_ObjectProxyMethods))

View File

@@ -52,7 +52,7 @@ class TestAdapterAttributes(unittest.TestCase):
self.assertEqual(function1d.__qualname__, __qualname__)
def test_module_name(self):
# Test preservation of function __module__ attribute.
# Test preservation of function __module__ attribute.
self.assertEqual(function1d.__module__, __name__)

View File

@@ -8,7 +8,7 @@ class TestArguments(unittest.TestCase):
def test_getcallargs(self):
def function(a, b=2, c=3, d=4, e=5, *args, **kwargs):
pass
pass
expected = {'a': 10, 'c': 3, 'b': 20, 'e': 5, 'd': 40,
'args': (), 'kwargs': {'f': 50}}

View File

@@ -50,7 +50,7 @@ class TestNamingFunction(unittest.TestCase):
self.assertEqual(function1d.__qualname__, __qualname__)
def test_module_name(self):
# Test preservation of function __module__ attribute.
# Test preservation of function __module__ attribute.
self.assertEqual(function1d.__module__, __name__)

View File

@@ -69,13 +69,13 @@ class TestNamingInnerClassMethod(unittest.TestCase):
self.assertEqual(Class().function.__qualname__, __qualname__)
def test_class_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class.function.__module__,
Original.function.__module__)
def test_instance_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class().function.__module__,
Original().function.__module__)

View File

@@ -49,7 +49,7 @@ class TestNamingInnerStaticMethod(unittest.TestCase):
Original().function.__name__)
def test_class_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class.function.__module__,
Original.function.__module__)
@@ -75,7 +75,7 @@ class TestNamingInnerStaticMethod(unittest.TestCase):
self.assertEqual(Class().function.__qualname__, __qualname__)
def test_instance_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class().function.__module__,
Original().function.__module__)

View File

@@ -69,13 +69,13 @@ class TestNamingInstanceMethodOldStyle(unittest.TestCase):
self.assertEqual(OldClass1d().function.__qualname__, __qualname__)
def test_class_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(OldClass1d.function.__module__,
OldClass1o.function.__module__)
def test_instance_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(OldClass1d().function.__module__,
OldClass1o().function.__module__)
@@ -172,13 +172,13 @@ class TestNamingInstanceMethodNewStyle(unittest.TestCase):
self.assertEqual(NewClass1d().function.__qualname__, __qualname__)
def test_class_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(NewClass1d.function.__module__,
NewClass1o.function.__module__)
def test_instance_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(NewClass1d().function.__module__,
NewClass1o().function.__module__)

View File

@@ -54,7 +54,7 @@ class TestNamingNestedFunction(unittest.TestCase):
self.assertEqual(function1d().__qualname__, __qualname__)
def test_module_name(self):
# Test preservation of function __module__ attribute.
# Test preservation of function __module__ attribute.
self.assertEqual(function1d().__module__, __name__)

View File

@@ -167,7 +167,7 @@ class TestNamingObjectProxy(unittest.TestCase):
self.assertEqual(wrapper.__qualname__, __qualname__)
def test_class_module_name(self):
# Test preservation of class __module__ attribute.
# Test preservation of class __module__ attribute.
target = objects.Target
wrapper = wrapt.ObjectProxy(target)
@@ -183,7 +183,7 @@ class TestNamingObjectProxy(unittest.TestCase):
self.assertEqual(wrapper.__doc__, target.__doc__)
def test_instance_module_name(self):
# Test preservation of instance __module__ attribute.
# Test preservation of instance __module__ attribute.
target = objects.Target()
wrapper = wrapt.ObjectProxy(target)
@@ -220,7 +220,7 @@ class TestNamingObjectProxy(unittest.TestCase):
self.assertEqual(wrapper.__qualname__, __qualname__)
def test_function_module_name(self):
# Test preservation of function __module__ attribute.
# Test preservation of function __module__ attribute.
target = objects.target
wrapper = wrapt.ObjectProxy(target)

View File

@@ -69,13 +69,13 @@ class TestNamingOuterClassMethod(unittest.TestCase):
self.assertEqual(Class().function.__qualname__, __qualname__)
def test_class_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class.function.__module__,
Original.function.__module__)
def test_instance_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class().function.__module__,
Original().function.__module__)

View File

@@ -69,13 +69,13 @@ class TestNamingOuterStaticMethod(unittest.TestCase):
self.assertEqual(Class().function.__qualname__, __qualname__)
def test_class_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class.function.__module__,
Original.function.__module__)
def test_instance_module_name(self):
# Test preservation of instance method __module__ attribute.
# Test preservation of instance method __module__ attribute.
self.assertEqual(Class().function.__module__,
Original().function.__module__)