summaryrefslogtreecommitdiffstats
path: root/Lib/test/buffer_tests.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-11-16 17:10:57 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-11-16 17:10:57 (GMT)
commit745d54d2fa1870bbb933579b390fdd1702874ead (patch)
tree9e0560c56181a5dea12bf970862db77dddba6afd /Lib/test/buffer_tests.py
parentb41c2547e0a5fa75d436d824e5f09f2327354e1a (diff)
downloadcpython-745d54d2fa1870bbb933579b390fdd1702874ead.zip
cpython-745d54d2fa1870bbb933579b390fdd1702874ead.tar.gz
cpython-745d54d2fa1870bbb933579b390fdd1702874ead.tar.bz2
#17806: Added keyword-argument support for "tabsize" to str/bytes.expandtabs().
Diffstat (limited to 'Lib/test/buffer_tests.py')
-rw-r--r--Lib/test/buffer_tests.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/Lib/test/buffer_tests.py b/Lib/test/buffer_tests.py
index cf54c28..0a62940 100644
--- a/Lib/test/buffer_tests.py
+++ b/Lib/test/buffer_tests.py
@@ -160,14 +160,20 @@ class MixinBytesBufferCommonTests(object):
self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(8))
self.assertEqual(b'abc\rab def\ng hi',
self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(4))
+ self.assertEqual(b'abc\r\nab def\ng hi',
+ self.marshal(b'abc\r\nab\tdef\ng\thi').expandtabs())
+ self.assertEqual(b'abc\r\nab def\ng hi',
+ self.marshal(b'abc\r\nab\tdef\ng\thi').expandtabs(8))
self.assertEqual(b'abc\r\nab def\ng hi',
self.marshal(b'abc\r\nab\tdef\ng\thi').expandtabs(4))
- self.assertEqual(b'abc\rab def\ng hi',
- self.marshal(b'abc\rab\tdef\ng\thi').expandtabs())
- self.assertEqual(b'abc\rab def\ng hi',
- self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(8))
self.assertEqual(b'abc\r\nab\r\ndef\ng\r\nhi',
- self.marshal(b'abc\r\nab\r\ndef\ng\r\nhi').expandtabs(4))
+ self.marshal(b'abc\r\nab\r\ndef\ng\r\nhi').expandtabs(4))
+ # check keyword args
+ self.assertEqual(b'abc\rab def\ng hi',
+ self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(tabsize=8))
+ self.assertEqual(b'abc\rab def\ng hi',
+ self.marshal(b'abc\rab\tdef\ng\thi').expandtabs(tabsize=4))
+
self.assertEqual(b' a\n b', self.marshal(b' \ta\n\tb').expandtabs(1))
self.assertRaises(TypeError, self.marshal(b'hello').expandtabs, 42, 42)