예제 #1
0
 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)))
예제 #2
0
 def test_start_step_stop(self):
     """Test start, step and stop."""
     self.assertEqual(parse_hyperslab('[0:2:9]'), (slice(0, 10, 2),))
예제 #3
0
 def test_invalid(self):
     """Test invalid hyperslab."""
     with self.assertRaises(ConstraintExpressionError):
         parse_hyperslab('[0:2:9:1]')
예제 #4
0
 def test_point(self):
     """Test a single value selection."""
     self.assertEqual(parse_hyperslab('[0]'), (slice(0, 1, 1),))
예제 #5
0
 def test_start_stop(self):
     """Test start and stop, default step."""
     self.assertEqual(parse_hyperslab('[0:1]'), (slice(0, 2, 1),))
예제 #6
0
파일: test_parsers.py 프로젝트: pydap/pydap
 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)))
예제 #7
0
파일: test_parsers.py 프로젝트: pydap/pydap
 def test_invalid(self):
     """Test invalid hyperslab."""
     with self.assertRaises(ConstraintExpressionError):
         parse_hyperslab("[0:2:9:1]")
예제 #8
0
파일: test_parsers.py 프로젝트: pydap/pydap
 def test_start_step_stop(self):
     """Test start, step and stop."""
     self.assertEqual(parse_hyperslab("[0:2:9]"), (slice(0, 10, 2),))
예제 #9
0
파일: test_parsers.py 프로젝트: pydap/pydap
 def test_start_stop(self):
     """Test start and stop, default step."""
     self.assertEqual(parse_hyperslab("[0:1]"), (slice(0, 2, 1),))
예제 #10
0
파일: test_parsers.py 프로젝트: pydap/pydap
 def test_point(self):
     """Test a single value selection."""
     self.assertEqual(parse_hyperslab("[0]"), (slice(0, 1, 1),))