Skip to content

Commit

Permalink
test cases for Bytes.join()
Browse files Browse the repository at this point in the history
  • Loading branch information
sziraqui committed Mar 8, 2018
1 parent 0e035a3 commit 0554e58
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/datatypes/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 0554e58

Please sign in to comment.