From f8e7459a602cb4cf97d3996936f795bc465faebc Mon Sep 17 00:00:00 2001 From: Tomasz Hemperek Date: Mon, 7 Jun 2021 12:54:50 +0200 Subject: [PATCH] Fix tests for bitarray changes in exeptions --- tests/test_BitLogic.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_BitLogic.py b/tests/test_BitLogic.py index 976b79e7..32e0b67a 100644 --- a/tests/test_BitLogic.py +++ b/tests/test_BitLogic.py @@ -141,20 +141,20 @@ def test_set_item(self): def assign_index(value): bl[4] = value - self.assertRaises(IndexError, lambda val: assign_index(val), []) - self.assertRaises(IndexError, lambda val: assign_index(val), [1, 2]) - self.assertRaises(IndexError, lambda val: assign_index(val), [True]) - self.assertRaises(IndexError, lambda val: assign_index(val), [False]) - self.assertRaises(IndexError, lambda val: assign_index(val), [True, False]) + self.assertRaises(TypeError, lambda val: assign_index(val), []) + self.assertRaises(TypeError, lambda val: assign_index(val), [1, 2]) + self.assertRaises(TypeError, lambda val: assign_index(val), [True]) + self.assertRaises(TypeError, lambda val: assign_index(val), [False]) + self.assertRaises(TypeError, lambda val: assign_index(val), [True, False]) def assign_slice(value): bl[2:1] = value - self.assertRaises(IndexError, lambda val: assign_slice(val), []) - self.assertRaises(IndexError, lambda val: assign_slice(val), [1, 2]) - self.assertRaises(IndexError, lambda val: assign_slice(val), [True]) - self.assertRaises(IndexError, lambda val: assign_slice(val), [False]) - self.assertRaises(IndexError, lambda val: assign_slice(val), [True, False]) + self.assertRaises(TypeError, lambda val: assign_slice(val), []) + self.assertRaises(TypeError, lambda val: assign_slice(val), [1, 2]) + self.assertRaises(TypeError, lambda val: assign_slice(val), [True]) + self.assertRaises(TypeError, lambda val: assign_slice(val), [False]) + self.assertRaises(TypeError, lambda val: assign_slice(val), [True, False]) def test_set_item_with_slice(self): ba = bitarray('001100000') @@ -211,8 +211,8 @@ def test_get_type_slicing_and_indexing(self): self.assertIsInstance(bl[3:1], bitarray) self.assertIsInstance(bl[1:1], bitarray) self.assertIsInstance(bl[2:2], bitarray) - self.assertIsInstance(bl[1], bool) - self.assertIsInstance(bl[2], bool) + self.assertIsInstance(bl[1], int) + self.assertIsInstance(bl[2], int) def test_get_slicing_and_indexing(self): bl = BitLogic('10000110')