예제 #1
0
 def test_invalid_step_value(self):
     with self.assertRaises(ValueError):
         core.complete_slice(slice(1, 1, 0), 1)
예제 #2
0
 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)
예제 #3
0
 def test_complete_slice(self):
     self.assertEqual(
         core.complete_slice(slice(*self.slice), 10),
         slice(*self.expect))
예제 #4
0
 def test_invalid_step_type(self):
     with self.assertRaises(IndexError):
         core.complete_slice(slice(1, 1, (1, 2)), 1)
예제 #5
0
 def test_invalid_step_value(self):
     with self.assertRaises(ValueError):
         core.complete_slice(slice(1, 1, 0), 1)
예제 #6
0
 def test_complete_slice(self):
     self.assertEqual(core.complete_slice(slice(*self.slice), 10),
                      slice(*self.expect))
예제 #7
0
 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)