def test_invalid_spatial_state(self): query = GranuleQuery() query.point(1, 2) self.assertFalse(query._valid_state()) query.polygon([(1, 1), (2, 1), (2, 2), (1, 1)]) self.assertFalse(query._valid_state()) query.bounding_box(1, 1, 2, 2) self.assertFalse(query._valid_state()) query.line([(1, 1), (2, 2)]) self.assertFalse(query._valid_state())
def test_bounding_box_set(self): query = GranuleQuery() query.bounding_box(1, 2, 3, 4) self.assertEqual(query.params["bounding_box"], "1.0,2.0,3.0,4.0")
def test_bounding_box_invalid_set(self): query = GranuleQuery() with self.assertRaises(ValueError): query.bounding_box(1, 2, 3, "invalid")