diff options
author | Laurent Peuch <cortex@worlddomination.be> | 2020-04-15 18:45:08 +0200 |
---|---|---|
committer | Laurent Peuch <cortex@worlddomination.be> | 2020-04-15 18:45:08 +0200 |
commit | 42389d0b7d38166f13e22fcb44c6c7bba8012eff (patch) | |
tree | 9401572cc48a29838c714ed22ac9184457cb8a55 /test | |
parent | edafcaf18af5d3c86959c768f2b9bcb4578f5723 (diff) | |
download | logilab-common-42389d0b7d38166f13e22fcb44c6c7bba8012eff.tar.gz |
add depreciation.renamed to rename callable
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_deprecation.py | 10 |
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') |