def test_invalid_step_value(self): with self.assertRaises(ValueError): core.complete_slice(slice(1, 1, 0), 1)
def test_invalid_stop_type(self): with self.assertRaises(IndexError): core.complete_slice(slice((1, 2), 1, 1), 1) with self.assertRaises(IndexError): core.complete_slice(slice((1, 2), 1, -1), 1)
def test_complete_slice(self): self.assertEqual( core.complete_slice(slice(*self.slice), 10), slice(*self.expect))
def test_invalid_step_type(self): with self.assertRaises(IndexError): core.complete_slice(slice(1, 1, (1, 2)), 1)
def test_complete_slice(self): self.assertEqual(core.complete_slice(slice(*self.slice), 10), slice(*self.expect))
def test_invalid_start_type(self): with self.assertRaises(IndexError): core.complete_slice(slice((1, 2), 1, 1), 1) with self.assertRaises(IndexError): core.complete_slice(slice((1, 2), 1, -1), 1)