summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-03-03 15:07:18 (GMT)
committerGitHub <noreply@github.com>2017-03-03 15:07:18 (GMT)
commitc7ff163abf428d73d4054754db3c99d06487e3ad (patch)
treea150495fe14a9a46db21bcf95d1988eae547d5d3 /Lib/test
parent2adc66848135be8e86ba08690a858737a65ae40d (diff)
downloadcpython-c7ff163abf428d73d4054754db3c99d06487e3ad.zip
cpython-c7ff163abf428d73d4054754db3c99d06487e3ad.tar.gz
cpython-c7ff163abf428d73d4054754db3c99d06487e3ad.tar.bz2
Add Python version since deprecation in base64 methods. (#33) (#429)
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. (cherry picked from commit c643a967dd7d33ccefa5b61b38caf40b448057ce)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_base64.py8
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")