Skip to content

Commit

Permalink
add no_such_product definition for failure with ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
awalshie committed Mar 28, 2018
1 parent 272147b commit ca829c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions integration_tests/index/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,11 @@ def matches_1(*args):

def matches_none(*args):
rows = _cli_csv_search(('datasets',) + args, clirunner)
assert len(lines) == 1
assert len(rows) == 0

def no_such_product(*args):
with pytest.raises(ValueError):
rows = _cli_csv_search(('datasets',) + args, clirunner)

matches_both(' -40 < lat < -10')
matches_both('product=' + pseudo_ls8_type.name)
Expand All @@ -1119,7 +1123,7 @@ def matches_none(*args):
matches_1('platform=LANDSAT_8', '2014-07-24<time<2014-07-27')

# One matching field, one non-matching
matches_none('2014-07-24<time<2014-07-27', 'platform=LANDSAT_5')
no_such_product('2014-07-24<time<2014-07-27', 'platform=LANDSAT_5')

# Test date shorthand
matches_both('2014-7 < time < 2014-8')
Expand Down

0 comments on commit ca829c1

Please sign in to comment.