summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Peuch <cortex@worlddomination.be>2020-04-15 18:45:08 +0200
committerLaurent Peuch <cortex@worlddomination.be>2020-04-15 18:45:08 +0200
commit42389d0b7d38166f13e22fcb44c6c7bba8012eff (patch)
tree9401572cc48a29838c714ed22ac9184457cb8a55 /test
parentedafcaf18af5d3c86959c768f2b9bcb4578f5723 (diff)
downloadlogilab-common-42389d0b7d38166f13e22fcb44c6c7bba8012eff.tar.gz
add depreciation.renamed to rename callable
Diffstat (limited to 'test')
-rw-r--r--test/unittest_deprecation.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py
index be64e07..d82c2bc 100644
--- a/test/unittest_deprecation.py
+++ b/test/unittest_deprecation.py
@@ -71,6 +71,16 @@ class RawInputTC(TestCase):
self.assertEqual(self.messages,
['The function "any_func" is deprecated', 'message'])
+ def test_renamed(self):
+ def any_func():
+ pass
+
+ old_func = deprecation.renamed("old_func", any_func)
+ old_func()
+
+ self.assertEqual(self.messages,
+ ['old_func has been renamed and is deprecated, uses any_func instead'])
+
def test_moved(self):
module = 'data.deprecation'
any_func = deprecation.moved(module, 'moving_target')