Skip to content

Commit

Permalink
Update Rule Evaluator to have default answer true
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuyuutsu committed Oct 16, 2024
1 parent bb42b8c commit 3151ce4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/app/questionnaire/rules/test_rule_evaluator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime, timezone
from typing import Optional, Union

from app.questionnaire.value_source_resolver import ValueSourceResolver
import pytest
from freezegun import freeze_time
from mock import MagicMock, Mock
Expand All @@ -19,6 +18,7 @@
from app.questionnaire.relationship_location import RelationshipLocation
from app.questionnaire.rules.operator import Operator
from app.questionnaire.rules.rule_evaluator import RuleEvaluator
from app.questionnaire.value_source_resolver import ValueSourceResolver
from app.utilities.schema import load_schema_from_name
from tests.app.questionnaire.conftest import get_metadata
from tests.app.questionnaire.test_value_source_resolver import (
Expand Down Expand Up @@ -64,12 +64,13 @@ def get_rule_evaluator(
schema.is_answer_in_list_collector_repeating_block = Mock(return_value=False)

list_item_id = location.list_item_id if location else None
value_source_resolver =ValueSourceResolver(
value_source_resolver = ValueSourceResolver(
schema=schema,
data_stores=data_stores,
location=location,
routing_path_block_ids=routing_path_block_ids,
list_item_id=list_item_id
list_item_id=list_item_id,
use_default_answer=True
)
return RuleEvaluator(
value_source_resolver=value_source_resolver,
Expand Down Expand Up @@ -926,7 +927,6 @@ def test_answer_source_default_answer_used_when_no_answer(
answer_store=AnswerStore([{"answer_id": "some-answer", "value": "No"}])
),
)

assert (
rule_evaluator.evaluate(
rule={
Expand Down

0 comments on commit 3151ce4

Please sign in to comment.