Пример #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)