From a87502d8a761243fe432be6da1235c11179149a7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 11 Jul 2013 21:40:20 -0400 Subject: Add tests for patch_with_metaclass --- test_six.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test_six.py') 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) -- cgit v1.2.1