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 c643a967dd)
This commit is contained in:
Berker Peksag 2017-03-03 18:07:18 +03:00 committed by GitHub
parent 2adc668481
commit c7ff163abf
3 changed files with 25 additions and 6 deletions

View file

@ -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")