summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-07-11 22:38:34 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-07-11 22:38:34 -0400
commit755754d17e88da2c5f763986039ccf68e219232c (patch)
tree7de7db147e5ff32ea26e2005eb6ee4eab103e7e0
parent57f6ab38e74b5fe130cbd92caa720c7a2ec11672 (diff)
downloadsix-755754d17e88da2c5f763986039ccf68e219232c.tar.gz
Expand patch_with_metaclass tests
-rw-r--r--test_six.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test_six.py b/test_six.py
index 16a09dd..adc55bd 100644
--- a/test_six.py
+++ b/test_six.py
@@ -524,18 +524,21 @@ def test_patch_with_metaclass():
def test_patch_with_metaclass_extra_meta():
class Meta1(type):
- pass
+ m1 = 'm1'
class Meta2(Meta1):
- pass
+ m2 = 'm2'
@six.patch_with_metaclass(Meta1)
class Base:
- pass
+ b = 'b'
@six.patch_with_metaclass(Meta2)
class X(Base):
- pass
+ x = 'x'
assert type(X) is Meta2
assert issubclass(X, Base)
assert type(Base) is Meta1
assert not '__dict__' in vars(X)
instance = X()
- vars(instance)
+ instance.attr = 'test'
+ assert vars(instance) == {'attr': 'test'}
+ assert instance.b == Base.b
+ assert instance.x == X.x