@@ -259,7 +259,7 @@ def test_buffer_endian(self):
259259 self .assertEQUAL (a , bitarray (0 , endian ))
260260
261261 a = bitarray (buffer = b'A' )
262- self .assertEqual (a .endian , "big" )
262+ self .assertEqual (a .endian , get_default_endian () )
263263 self .assertEqual (len (a ), 8 )
264264
265265 def test_buffer_readonly (self ):
@@ -2405,16 +2405,16 @@ def test_frozenbitarray(self):
24052405 @skipIf (is_pypy )
24062406 def test_imported (self ):
24072407 a = bytearray ([0xf0 , 0x01 , 0x02 , 0x0f ])
2408- b = bitarray (buffer = a )
2408+ b = bitarray (buffer = a , endian = 'big' )
24092409 self .assertFalse (b .readonly )
24102410 # operate on imported (writable) buffer
24112411 b [8 :24 ] <<= 3
24122412 self .assertEqual (a , bytearray ([0xf0 , 0x08 , 0x10 , 0x0f ]))
2413- b [0 :9 ] |= bitarray ("0000 1100 1" )
2413+ b [0 :9 ] |= bitarray ("0000 1100 1" , 'big' )
24142414 self .assertEqual (a , bytearray ([0xfc , 0x88 , 0x10 , 0x0f ]))
2415- b [23 :] ^= bitarray ("1 1110 1110" )
2415+ b [23 :] ^= bitarray ("1 1110 1110" , 'big' )
24162416 self .assertEqual (a , bytearray ([0xfc , 0x88 , 0x11 , 0xe1 ]))
2417- b [16 :] &= bitarray ("1111 0000 1111 0000" )
2417+ b [16 :] &= bitarray ("1111 0000 1111 0000" , 'big' )
24182418 self .assertEqual (a , bytearray ([0xfc , 0x88 , 0x10 , 0xe0 ]))
24192419 b >>= 8
24202420 self .assertEqual (a , bytearray ([0x00 , 0xfc , 0x88 , 0x10 ]))
@@ -4714,10 +4714,10 @@ def test_copy(self):
47144714 @skipIf (is_pypy )
47154715 def test_bitarray_shared_sections (self ):
47164716 a = urandom_2 (0x2000 , 'big' )
4717- b = bitarray (buffer = memoryview (a )[0x100 :0x300 ])
4717+ b = bitarray (buffer = memoryview (a )[0x100 :0x300 ], endian = 'big' )
47184718 self .assertEqual (b .buffer_info ().address ,
47194719 a .buffer_info ().address + 0x100 )
4720- c = bitarray (buffer = memoryview (a )[0x200 :0x800 ])
4720+ c = bitarray (buffer = memoryview (a )[0x200 :0x800 ], endian = 'big' )
47214721 self .assertEqual (c .buffer_info ().address ,
47224722 a .buffer_info ().address + 0x200 )
47234723 self .assertEqual (a [8 * 0x100 : 8 * 0x300 ], b )
0 commit comments