Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"pipeline with a different one is refused. Build another cloud engine "
"for this pipeline, or use the same Cloud Request Engine in both.")

# The values HumanConfidence can have.
HUMAN_CONFIDENCE_VALUES = ("High", "Medium", "Low", "Unknown")
# The values HumanConfidence can have. Unknown is not one of them.
HUMAN_CONFIDENCE_VALUES = ("High", "Medium", "Low")

class OnPremiseMissingPropertyService(MissingPropertyService):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,14 @@ def test_without_a_sealed_result_the_response_is_read_as_before(self):
self.assert_values(data, "Low", "Passive")
self.assertNotIn("transaction", self.cloud.data_requests[-1])

# HumanConfidence is only ever High, Medium, Low or Unknown, the values
# the property has, whatever text the cloud service returns.
# HumanConfidence is only ever High, Medium or Low, the values the
# property has, whatever text the cloud service returns. Unknown is not
# one of them.

OTHER_TEXT = ("hc1.eyJ2IjoxfQ.c2VhbGVk", "high", "", 3)
OTHER_TEXT = ("hc1.eyJ2IjoxfQ.c2VhbGVk", "high", "", 3, "Unknown")

def test_a_sealed_request_gives_medium_for_any_other_text(self):
for value in self.OTHER_TEXT + ("Unknown",):
for value in self.OTHER_TEXT:
for page, message in ((True, VALUE_NOT_KNOWN),
(None, NO_TRANSACTION)):
with self.subTest(value=value, page=page):
Expand Down Expand Up @@ -647,7 +648,7 @@ def test_without_a_sealed_result_other_text_gives_no_value(self):
self.assertEqual({}, dict(data.errors))

def test_without_a_sealed_result_each_value_is_read_unchanged(self):
for value in ("High", "Medium", "Low", "Unknown"):
for value in ("High", "Medium", "Low"):
with self.subTest(value=value):
self.cloud.answer = reply({"derived": {
"humanconfidence": value,
Expand Down
Loading