diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-07-11 21:40:20 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-07-11 21:40:20 -0400 |
commit | a87502d8a761243fe432be6da1235c11179149a7 (patch) | |
tree | 64b6bc58fea1b110b12bfeefa78f34835be306e3 /test_six.py | |
parent | c6aa3ae732a820ef49c474262a34afa15a6dbd0d (diff) | |
download | six-git-a87502d8a761243fe432be6da1235c11179149a7.tar.gz |
Add tests for patch_with_metaclass
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test_six.py b/test_six.py index 4d7a233..bb306e8 100644 --- a/test_six.py +++ b/test_six.py @@ -496,3 +496,28 @@ def test_with_metaclass(): assert type(X) is Meta assert issubclass(X, Base) assert issubclass(X, Base2) + + +def test_patch_with_metaclass(): + class Meta(type): + pass + @six.patch_with_metaclass(Meta) + class X: + pass + assert type(X) is Meta + assert issubclass(X, object) + class Base(object): + pass + @six.patch_with_metaclass(Meta) + class X(Base): + pass + assert type(X) is Meta + assert issubclass(X, Base) + class Base2(object): + pass + @six.patch_with_metaclass(Meta) + class X(Base, Base2): + pass + assert type(X) is Meta + assert issubclass(X, Base) + assert issubclass(X, Base2) |