Skip to content

Commit

Permalink
tests: adjust for llm content check
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward-Jackson-ONS committed Aug 21, 2024
1 parent 7e74e14 commit 6d57bdf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/readers/base/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ def test_load_config_default():
# TODO: keywords hardcoded not ideal for flexible keywords
expected = {
"urls": [],
"inconsistency_statement": "",
"keywords": ["Office for National Statistics", "ONS"],
"prompt": "",
"outdir": "",
"llm_name": "",
}
config = ToyReader._load_config()

assert config == expected
assert config.keys() == expected.keys()


@given(st_terms_and_texts())
Expand Down Expand Up @@ -294,7 +295,12 @@ def test_analyse(params):
response = reader.analyse({"text": "foo"})

assert isinstance(response, dict) and "response" in response
assert response["response"].split("\n\n") == responses

# do not include LLM content warning in this test
response_split = response["response"].split("\n\n")
assert [
x for x in response_split if not x.startswith(":warning:")
] == responses

splitter.assert_called_once_with("foo")

Expand Down

0 comments on commit 6d57bdf

Please sign in to comment.