from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase


class BytesTests(TranspileTestCase):
    def test_setattr(self):
        self.assertCodeExecution("""
            x = b'hello, world'
            try:
                x.attr = 42
            except AttributeError as err:
                print(err)
            """)

    def test_islower(self):
        self.assertCodeExecution("""
            print(b'abc'.islower())
            print(b''.islower())
            print(b'Abccc'.islower())
            print(b'HELLO WORD'.islower())
            print(b'@#$%!'.islower())
            print(b'hello world'.islower())
            print(b'hello world   '.islower())
            # TODO: uncomment when adding support for literal hex bytes
            #print(b'\xf0'.islower())

        """)