From 0554e580c24e9f73f0c8f0766afe91cd669dcab4 Mon Sep 17 00:00:00 2001 From: Sarfaraz Ghulam Iraqui Date: Thu, 8 Mar 2018 13:39:23 +0530 Subject: [PATCH] test cases for Bytes.join() --- tests/datatypes/test_bytes.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/datatypes/test_bytes.py b/tests/datatypes/test_bytes.py index 5646257ff0..9776ca39d6 100644 --- a/tests/datatypes/test_bytes.py +++ b/tests/datatypes/test_bytes.py @@ -277,7 +277,7 @@ def test_contains(self): def test_isalnum(self): self.assertCodeExecution(""" - print(b'w1thnumb3r2'.isalnum()) + print(b'w1thnumb3r2'.isalnum('jk')) print(b'withoutnumber'.isalnum()) print(b'with spaces'.isalnum()) print(b'666'.isalnum()) @@ -503,6 +503,20 @@ def test_split(self): print(b''.split(maxsplit='5')) """, exits_early=True) + def test_join(self): + self.assertCodeExecution(""" + b = bytes(b'.') + print(b.join([b'12', b'dh'])) + print(b.join([bytearray(b'12'), bytearray(b'dh')])) + b = bytes(b' ') + print(b.join([b'd', bytearray(b'l22-'), b'=ej*'])) + print(b.join([bytearray(b'31'), b'`', b'^'])) + print(b.join([bytearray(b'dh')])) + b = bytes(b'%#@!') + print(b.join([b'1',b'd',b'<'])) + print(b.join([b'12'])) + """) + class UnaryBytesOperationTests(UnaryOperationTestCase, TranspileTestCase): data_type = 'bytes'