def test_ndimensionsal(self): """Test n-dimensional slices.""" self.assertEqual( parse_hyperslab('[0:2:9][0][0:99]'), (slice(0, 10, 2), slice(0, 1, 1), slice(0, 100, 1)))
def test_start_step_stop(self): """Test start, step and stop.""" self.assertEqual(parse_hyperslab('[0:2:9]'), (slice(0, 10, 2),))
def test_invalid(self): """Test invalid hyperslab.""" with self.assertRaises(ConstraintExpressionError): parse_hyperslab('[0:2:9:1]')
def test_point(self): """Test a single value selection.""" self.assertEqual(parse_hyperslab('[0]'), (slice(0, 1, 1),))
def test_start_stop(self): """Test start and stop, default step.""" self.assertEqual(parse_hyperslab('[0:1]'), (slice(0, 2, 1),))
def test_ndimensionsal(self): """Test n-dimensional slices.""" self.assertEqual(parse_hyperslab("[0:2:9][0][0:99]"), (slice(0, 10, 2), slice(0, 1, 1), slice(0, 100, 1)))
def test_invalid(self): """Test invalid hyperslab.""" with self.assertRaises(ConstraintExpressionError): parse_hyperslab("[0:2:9:1]")
def test_start_step_stop(self): """Test start, step and stop.""" self.assertEqual(parse_hyperslab("[0:2:9]"), (slice(0, 10, 2),))
def test_start_stop(self): """Test start and stop, default step.""" self.assertEqual(parse_hyperslab("[0:1]"), (slice(0, 2, 1),))
def test_point(self): """Test a single value selection.""" self.assertEqual(parse_hyperslab("[0]"), (slice(0, 1, 1),))