diff options
author | Joshua Harlow <harlowja@gmail.com> | 2014-04-28 22:18:44 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2014-04-28 22:18:44 -0700 |
commit | 1451a4f3808a50bcc02898c64f4f1e1b73521bb6 (patch) | |
tree | c5754911179d3fff91b799d1cfdd25707af3da9e /test_six.py | |
parent | 0751ae0775c48a18623a7f2e4ce129b6f73eacc6 (diff) | |
download | six-git-1451a4f3808a50bcc02898c64f4f1e1b73521bb6.tar.gz |
Add a test for wraps
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test_six.py b/test_six.py index 9e39444..371ee81 100644 --- a/test_six.py +++ b/test_six.py @@ -636,6 +636,24 @@ def test_with_metaclass(): assert issubclass(X, Base2) +def test_wraps(): + def f(g): + @six.wraps(g) + def w(): + return 42 + return w + def k(): + pass + original_k = k + k = f(f(k)) + assert hasattr(k, '__wrapped__') + k = k.__wrapped__ + assert hasattr(k, '__wrapped__') + k = k.__wrapped__ + assert k is original_k + assert not hasattr(k, '__wrapped__') + + def test_add_metaclass(): class Meta(type): pass |