diff options
author | Matthias Bussonnier <bussonniermatthias@gmail.com> | 2017-03-02 14:21:26 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2017-03-02 14:21:26 (GMT) |
commit | c643a967dd7d33ccefa5b61b38caf40b448057ce (patch) | |
tree | dbd3e5ea14a08efc58b5e30ba2e8a55346344604 /Lib/test/test_base64.py | |
parent | 698845eba71f98d11671f2e1af6dac2f54a3751d (diff) | |
download | cpython-c643a967dd7d33ccefa5b61b38caf40b448057ce.zip cpython-c643a967dd7d33ccefa5b61b38caf40b448057ce.tar.gz cpython-c643a967dd7d33ccefa5b61b38caf40b448057ce.tar.bz2 |
Add Python version since deprecation in base64 methods. (#33)
Allow developers to not have to either test on N Python versions or
looked through multiple versions of the docs to know whether they can
easily update.
Diffstat (limited to 'Lib/test/test_base64.py')
-rw-r--r-- | Lib/test/test_base64.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py index 4f86aaa..4754739 100644 --- a/Lib/test/test_base64.py +++ b/Lib/test/test_base64.py @@ -18,6 +18,14 @@ class LegacyBase64TestCase(unittest.TestCase): int_data = memoryview(b"1234").cast('I') self.assertRaises(TypeError, f, int_data) + def test_encodestring_warns(self): + with self.assertWarns(DeprecationWarning): + base64.encodestring(b"www.python.org") + + def test_decodestring_warns(self): + with self.assertWarns(DeprecationWarning): + base64.decodestring(b"d3d3LnB5dGhvbi5vcmc=\n") + def test_encodebytes(self): eq = self.assertEqual eq(base64.encodebytes(b"www.python.org"), b"d3d3LnB5dGhvbi5vcmc=\n") |