Skip to content

Commit

Permalink
Tests query group_by and measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdhicks committed Jun 2, 2016
1 parent e7127f0 commit 8621fe8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion datacube/api/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def group_by(self):
group_by_func=solar_day,
units='seconds since 1970-01-01 00:00:00')
else:
raise NotImplementedError('No group by function for', self.group_by_name)
raise LookupError('No group by function for', self.group_by_name)

def __repr__(self):
return self.__str__()
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def check_open_with_grid_workflow(index):
dataset_cell = gw.load(LBG_CELL, type=type_name, variables=['blue'])
assert dataset_cell['blue'].size

dataset_cell = gw.load(LBG_CELL, type=type_name)
assert all(m in dataset_cell for m in ['blue', 'green', 'red', 'nir', 'swir1', 'swir2'])

#
# data_array_cell = dc.get_data_array_by_cell(LBG_CELL, storage_type='ls5_nbar_albers', variables=['blue'])
# assert data_array_cell.size
Expand Down
4 changes: 4 additions & 0 deletions tests/api/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,7 @@ def test_query_kwargs():

with pytest.raises(LookupError):
Query.from_kwargs(index=mock_index, y=-4174726, x=1515184, crs='EPSG:3577', made_up_key='NotReal')

with pytest.raises(LookupError):
query = Query.from_kwargs(index=mock_index, y=-4174726, x=1515184, crs='EPSG:3577', group_by='magic')
query.group_by

0 comments on commit 8621fe8

Please sign in to comment.