Skip to content

Commit

Permalink
test: add failure test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanorosanelli committed Oct 28, 2024
1 parent 8768bea commit ec5dce5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,18 @@ def test_refine_text_analysis():
result = service.run(payload)
assert 'output' in result
assert 'token_data' in result


def test_refine_text_analysis_fail():
"""Test refine text analysis service failure"""
service = RefineTextAnalysisService()
with pytest.raises(ValueError) as exc:
service.run({})
assert str(exc.value) == 'Invalid service payload - {}'

with pytest.raises(ValueError) as exc:
service.run({
'file_path': '/some/path',
'prompts': {'a': 'b'}
})
assert str(exc.value).startswith('Invalid service payload - ')

0 comments on commit ec5dce5

Please sign in to comment.