def test_titles_for_repeating_section_summary(people_answer_store):
    schema = load_schema_from_name(
        "test_repeating_sections_with_hub_and_spoke")

    section_summary_context = SectionSummaryContext(
        DEFAULT_LANGUAGE_CODE,
        schema,
        people_answer_store,
        ListStore([
            {
                "items": ["PlwgoG", "UHPLbX"],
                "name": "people"
            },
            {
                "items": ["gTrlio"],
                "name": "visitors"
            },
        ]),
        ProgressStore(),
        {},
        current_location=Location(
            section_id="personal-details-section",
            list_name="people",
            list_item_id="PlwgoG",
        ),
        routing_path=MagicMock(),
    )

    context = section_summary_context()

    assert context["summary"]["title"] == "Toni Morrison"

    section_summary_context = SectionSummaryContext(
        DEFAULT_LANGUAGE_CODE,
        schema,
        people_answer_store,
        ListStore([
            {
                "items": ["PlwgoG", "UHPLbX"],
                "name": "people"
            },
            {
                "items": ["gTrlio"],
                "name": "visitors"
            },
        ]),
        ProgressStore(),
        {},
        current_location=Location(
            block_id="personal-summary",
            section_id="personal-details-section",
            list_name="people",
            list_item_id="UHPLbX",
        ),
        routing_path=MagicMock(),
    )

    context = section_summary_context()
    assert context["summary"]["title"] == "Barry Pheloung"
    def test_routing_path(self):
        schema = load_schema_from_name("test_summary")
        section_id = schema.get_section_id_for_block_id("dessert")
        expected_path = RoutingPath(
            ["radio", "dessert", "dessert-confirmation", "numbers", "summary"],
            section_id="default-section",
        )

        progress_store = ProgressStore([{
            "section_id":
            "default-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.COMPLETED,
            "block_ids": [
                "radio",
                "dessert",
                "dessert-confirmation",
                "numbers",
            ],
        }])
        path_finder = PathFinder(schema, self.answer_store, self.list_store,
                                 progress_store, self.metadata)
        routing_path = path_finder.routing_path(section_id=section_id)

        self.assertEqual(routing_path, expected_path)
    def test_routing_path_should_not_skip_group(self):
        # Given
        schema = load_schema_from_name("test_skip_condition_group")

        section_id = schema.get_section_id_for_block_id("do-you-want-to-skip")
        answer_store = AnswerStore()
        answer_store.add_or_update(
            Answer(answer_id="do-you-want-to-skip-answer", value="No"))
        progress_store = ProgressStore([{
            "section_id": "default-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["do-you-want-to-skip"],
        }])

        # When
        path_finder = PathFinder(schema, answer_store, self.list_store,
                                 progress_store, self.metadata)
        routing_path = path_finder.routing_path(section_id=section_id)

        # Then
        expected_routing_path = RoutingPath(
            [
                "do-you-want-to-skip", "should-skip", "last-group-block",
                "summary"
            ],
            section_id="default-section",
        )

        with patch("app.questionnaire.path_finder.evaluate_skip_conditions",
                   return_value=False):
            self.assertEqual(routing_path, expected_routing_path)
Example #4
0
    def test_routing_path_with_conditional_path(self):
        schema = load_schema_from_name("test_new_routing_number_equals")
        section_id = schema.get_section_id_for_block_id("number-question")
        expected_path = RoutingPath(
            ["number-question", "correct-answer"],
            section_id="default-section",
        )

        answer = Answer(answer_id="answer", value=123)
        answer_store = AnswerStore()
        answer_store.add_or_update(answer)
        progress_store = ProgressStore([{
            "section_id": "default-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["number-question"],
        }])
        path_finder = PathFinder(
            schema,
            answer_store,
            self.list_store,
            progress_store,
            self.metadata,
            self.response_metadata,
        )

        routing_path = path_finder.routing_path(section_id=section_id)

        self.assertEqual(routing_path, expected_path)
Example #5
0
 def setUp(self):
     super().setUp()
     self.schema = load_schema_from_name("test_section_summary")
     self.answer_store = AnswerStore()
     self.list_store = ListStore()
     self.progress_store = ProgressStore()
     self.block_type = "SectionSummary"
Example #6
0
    def __init__(self,
                 storage: EncryptedQuestionnaireStorage,
                 version: Optional[int] = None):
        self._storage = storage
        if version is None:
            version = self.get_latest_version_number()
        self.version = version
        self._metadata: dict[str, Any] = {}
        # self.metadata is a read-only view over self._metadata
        self.metadata: Mapping[str, Any] = MappingProxyType(self._metadata)
        self.response_metadata: Mapping[str, Any] = {}
        self.list_store = ListStore()
        self.answer_store = AnswerStore()
        self.progress_store = ProgressStore()
        self.submitted_at: Optional[datetime]
        self.collection_exercise_sid: Optional[str]

        (
            raw_data,
            self.collection_exercise_sid,
            version,
            self.submitted_at,
        ) = self._storage.get_user_data()

        if raw_data:
            self._deserialize(raw_data)
        if version is not None:
            self.version = version
Example #7
0
    def test_routing_path_with_complete_introduction(self):
        schema = load_schema_from_name("test_introduction")
        section_id = schema.get_section_id_for_block_id("introduction")
        progress_store = ProgressStore([{
            "section_id": "introduction-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["introduction"],
        }])
        expected_routing_path = RoutingPath(
            ["introduction", "general-business-information-completed"],
            section_id="introduction-section",
        )

        path_finder = PathFinder(
            schema,
            self.answer_store,
            self.list_store,
            progress_store,
            self.metadata,
            self.response_metadata,
        )
        routing_path = path_finder.routing_path(section_id=section_id)

        self.assertEqual(routing_path, expected_routing_path)
    def test_return_to_final_summary_section_is_in_progress(self):
        self.schema = load_schema_from_name("test_submit_with_summary")
        self.progress_store = ProgressStore([{
            "section_id":
            "default-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.IN_PROGRESS,
            "block_ids": [
                "radio",
                "dessert",
                "dessert-confirmation",
                "numbers",
            ],
        }])

        current_location = Location(section_id="default-section",
                                    block_id="dessert")
        routing_path = RoutingPath(
            ["radio", "dessert", "dessert-confirmation", "numbers"],
            section_id="default-section",
        )
        previous_location = self.router.get_previous_location_url(
            current_location,
            routing_path,
            return_to="final-summary",
            return_to_answer_id="dessert-answer",
        )

        self.assertIn(
            "/questionnaire/radio/?return_to=final-summary#dessert-answer",
            previous_location,
        )
    def test_is_none_on_first_block_single_section(self):
        self.schema = load_schema_from_name("test_checkbox")
        self.progress_store = ProgressStore([{
            "section_id":
            "default-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.IN_PROGRESS,
            "block_ids": ["mandatory-checkbox"],
        }])
        routing_path = RoutingPath(
            [
                "mandatory-checkbox", "non-mandatory-checkbox",
                "single-checkbox"
            ],
            section_id="default-section",
        )

        current_location = Location(section_id="default-section",
                                    block_id="mandatory-checkbox")
        previous_location_url = self.router.get_previous_location_url(
            current_location, routing_path)

        self.assertIsNone(previous_location_url)
    def test_return_to_final_summary_questionnaire_is_not_complete(self):
        self.schema = load_schema_from_name(
            "test_new_routing_to_questionnaire_end_multiple_sections")
        self.answer_store = AnswerStore([{
            "answer_id": "test-answer",
            "value": "Yes"
        }])
        self.progress_store = ProgressStore([{
            "section_id": "test-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["test-forced"],
        }])

        current_location = Location(section_id="test-section",
                                    block_id="test-forced")
        routing_path = RoutingPath(["test-forced"], section_id="test-section")
        next_location = self.router.get_next_location_url(
            current_location, routing_path, return_to="final-summary")
        expected_location = Location(
            section_id="test-section-2",
            block_id="test-optional",
            list_item_id=None,
        )

        self.assertEqual(expected_location.url(), next_location)
    def test_return_to_section_summary_section_is_in_progress(self):
        self.schema = load_schema_from_name("test_section_summary")
        self.progress_store = ProgressStore([{
            "section_id":
            "property-details-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.IN_PROGRESS,
            "block_ids": ["insurance-type", "insurance-address", "listed"],
        }])

        current_location = Location(section_id="property-details-section",
                                    block_id="insurance-address")
        routing_path = RoutingPath(
            ["insurance-type", "insurance-address", "listed"],
            section_id="default-section",
        )
        previous_location_url = self.router.get_previous_location_url(
            current_location,
            routing_path,
            return_to="section-summary",
            return_to_answer_id="insurance-address-answer",
        )

        self.assertIn(
            "/questionnaire/insurance-type/?return_to=section-summary#insurance-address-answer",
            previous_location_url,
        )
    def test_return_to_section_summary_section_is_complete(self):
        self.schema = load_schema_from_name("test_section_summary")
        self.progress_store = ProgressStore([{
            "section_id":
            "property-details-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.COMPLETED,
            "block_ids": [
                "insurance-type",
                "insurance-address",
                "listed",
            ],
        }])

        current_location = Location(section_id="property-details-section",
                                    block_id="insurance-type")
        routing_path = RoutingPath(
            ["insurance-type", "insurance-address", "listed"],
            section_id="property-details-section",
        )
        next_location = self.router.get_next_location_url(
            current_location, routing_path, return_to="section-summary")

        self.assertIn("/questionnaire/sections/property-details-section/",
                      next_location)
    def test_within_section(self):
        self.schema = load_schema_from_name("test_checkbox")
        self.progress_store = ProgressStore([{
            "section_id":
            "default-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.IN_PROGRESS,
            "block_ids": ["mandatory-checkbox"],
        }])

        current_location = Location(section_id="default-section",
                                    block_id="mandatory-checkbox")
        routing_path = RoutingPath(
            [
                "mandatory-checkbox", "non-mandatory-checkbox",
                "single-checkbox"
            ],
            section_id="default-section",
        )
        next_location = self.router.get_next_location_url(
            current_location, routing_path)

        expected_location = Location(section_id="default-section",
                                     block_id="non-mandatory-checkbox").url()

        self.assertEqual(expected_location, next_location)
    def test_is_complete_with_repeating_sections(self):
        self.schema = load_schema_from_name(
            "test_repeating_sections_with_hub_and_spoke")
        self.progress_store = ProgressStore([
            {
                "section_id":
                "section",
                "status":
                CompletionStatus.COMPLETED,
                "block_ids": [
                    "primary-person-list-collector",
                    "list-collector",
                    "next-interstitial",
                    "another-list-collector-block",
                ],
            },
            {
                "section_id": "personal-details-section",
                "status": CompletionStatus.COMPLETED,
                "list_item_id": "abc123",
                "block_ids": ["proxy", "date-of-birth", "confirm-dob", "sex"],
            },
        ])
        self.list_store = ListStore([{
            "items": ["abc123"],
            "name": "people",
            "primary_person": "abc123"
        }])

        is_questionnaire_complete = self.router.is_questionnaire_complete

        self.assertTrue(is_questionnaire_complete)
def test_primary_links_for_section_summary(people_answer_store):
    schema = load_schema_from_name("test_list_collector_section_summary")

    summary_context = SectionSummaryContext(
        language=DEFAULT_LANGUAGE_CODE,
        schema=schema,
        answer_store=people_answer_store,
        list_store=ListStore(
            [
                {
                    "items": ["PlwgoG", "fg0sPd"],
                    "name": "people",
                    "primary_person": "PlwgoG",
                }
            ]
        ),
        progress_store=ProgressStore(),
        metadata={"display_address": "70 Abingdon Road, Goathill"},
        response_metadata={},
        current_location=Location(section_id="section"),
        routing_path=RoutingPath(
            [
                "primary-person-list-collector",
                "list-collector",
                "visitor-list-collector",
            ],
            section_id="section",
        ),
    )
    context = summary_context()

    list_items = context["summary"]["custom_summary"][0]["list"]["list_items"]

    assert "/edit-person/" in list_items[0]["edit_link"]
    assert "/edit-person/" in list_items[1]["edit_link"]
def test_remove_final_completed_location_removes_section():
    completed = [
        {
            "section_id": "s1",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["one"],
        },
        {
            "section_id": "s2",
            "list_item_id": "abc123",
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["three"],
        },
    ]
    store = ProgressStore(completed)

    non_repeating_location = Location(section_id="s1", block_id="one")
    repeating_location = Location(section_id="s2",
                                  block_id="three",
                                  list_name="people",
                                  list_item_id="abc123")

    store.remove_completed_location(non_repeating_location)
    store.remove_completed_location(repeating_location)

    assert ("s1", None) not in store
    assert store.get_completed_block_ids(section_id="s1") == []

    assert ("s2", "abc123") not in store
    assert store.get_completed_block_ids(section_id="s1",
                                         list_item_id="abc123") == []

    assert store.is_dirty
    def test_evaluate_skip_condition_returns_false_when_no_skip_condition(
            self):
        # Given
        skip_conditions = None

        answer_store = AnswerStore()

        current_location = Location(section_id="some-section",
                                    block_id="some-block")

        path_finder = PathFinder(
            get_schema(),
            answer_store,
            list_store=ListStore(),
            metadata={},
            progress_store=ProgressStore(),
            response_metadata={},
        )

        routing_path_block_ids = []

        # When
        condition = path_finder.evaluate_skip_conditions(
            current_location, routing_path_block_ids, skip_conditions)

        # Then
        self.assertFalse(condition)
def test_update_section_status():
    completed = [
        {
            "section_id": "s1",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["one"],
        },
        {
            "section_id": "s2",
            "list_item_id": "abc123",
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["three"],
        },
    ]
    store = ProgressStore(completed)

    store.update_section_status(section_status=CompletionStatus.IN_PROGRESS,
                                section_id="s1")
    store.update_section_status(
        section_status=CompletionStatus.IN_PROGRESS,
        section_id="s2",
        list_item_id="abc123",
    )

    assert store.get_section_status(
        section_id="s1") == CompletionStatus.IN_PROGRESS
    assert (store.get_section_status(
        section_id="s2",
        list_item_id="abc123") == CompletionStatus.IN_PROGRESS)
    assert store.is_dirty
Example #19
0
 def _deserialize(self, data: str) -> None:
     json_data = json_loads(data)
     self.progress_store = ProgressStore(json_data.get("PROGRESS"))
     self.set_metadata(json_data.get("METADATA", {}))
     self.answer_store = AnswerStore(json_data.get("ANSWERS"))
     self.list_store = ListStore.deserialize(json_data.get("LISTS"))
     self.response_metadata = json_data.get("RESPONSE_METADATA", {})
def test_deserialisation():
    in_progress_sections = [
        {
            "section_id": "s1",
            "list_item_id": None,
            "status": CompletionStatus.IN_PROGRESS,
            "block_ids": ["one", "two"],
        },
        {
            "section_id": "s2",
            "list_item_id": "abc123",
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["three", "four"],
        },
    ]
    store = ProgressStore(in_progress_sections)

    assert store.get_section_status(
        section_id="s1") == CompletionStatus.IN_PROGRESS
    assert store.get_completed_block_ids("s1") == ["one", "two"]

    assert (store.get_section_status(
        section_id="s2", list_item_id="abc123") == CompletionStatus.COMPLETED)
    assert store.get_completed_block_ids(section_id="s2",
                                         list_item_id="abc123") == [
                                             "three",
                                             "four",
                                         ]
Example #21
0
    def test_new_routing_path_should_skip_group(self):
        # Given
        schema = load_schema_from_name("test_new_skip_condition_group")

        section_id = schema.get_section_id_for_block_id("do-you-want-to-skip")
        answer_store = AnswerStore()
        answer_store.add_or_update(
            Answer(answer_id="do-you-want-to-skip-answer", value="Yes"))
        progress_store = ProgressStore([{
            "section_id": "default-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["do-you-want-to-skip"],
        }])

        # When
        path_finder = PathFinder(
            schema,
            answer_store,
            self.list_store,
            progress_store,
            self.metadata,
            self.response_metadata,
        )
        routing_path = path_finder.routing_path(section_id=section_id)

        # Then
        expected_routing_path = RoutingPath(
            ["do-you-want-to-skip"],
            section_id="default-section",
        )

        self.assertEqual(routing_path, expected_routing_path)
Example #22
0
    def test_remove_all_answers_with_list_item_id(self):
        answer_store = AnswerStore(existing_answers=[
            {
                "answer_id": "test1",
                "value": 1,
                "list_item_id": "abcdef"
            },
            {
                "answer_id": "test2",
                "value": 2,
                "list_item_id": "abcdef"
            },
            {
                "answer_id": "test3",
                "value": 3,
                "list_item_id": "uvwxyz"
            },
        ])

        questionnaire_store = MagicMock(
            spec=QuestionnaireStore,
            completed_blocks=[],
            answer_store=answer_store,
            list_store=MagicMock(spec=ListStore),
            progress_store=ProgressStore(),
        )

        self.questionnaire_store_updater = QuestionnaireStoreUpdater(
            self.location, self.schema, questionnaire_store,
            self.current_question)
        self.questionnaire_store_updater.remove_list_item_and_answers(
            "abc", "abcdef")

        assert len(answer_store) == 1
        assert answer_store.get_answer("test3", "uvwxyz")
Example #23
0
    def test_routing_path_empty_routing_rules(self):
        schema = load_schema_from_name("test_checkbox")
        section_id = schema.get_section_id_for_block_id("mandatory-checkbox")
        expected_path = RoutingPath(
            [
                "mandatory-checkbox", "non-mandatory-checkbox",
                "single-checkbox"
            ],
            section_id="default-section",
        )

        answer_1 = Answer(answer_id="mandatory-checkbox-answer",
                          value="Cheese")
        answer_2 = Answer(answer_id="non-mandatory-checkbox-answer",
                          value="deep pan")
        answer_3 = Answer(answer_id="single-checkbox-answer", value="Estimate")

        answer_store = AnswerStore()
        answer_store.add_or_update(answer_1)
        answer_store.add_or_update(answer_2)
        answer_store.add_or_update(answer_3)

        progress_store = ProgressStore([{
            "section_id": "default-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["mandatory-checkbox"],
        }])

        path_finder = PathFinder(schema, answer_store, self.list_store,
                                 progress_store, self.metadata)
        routing_path = path_finder.routing_path(section_id=section_id)

        self.assertEqual(routing_path, expected_path)
Example #24
0
    def test_remove_primary_person(self):
        answer_store = AnswerStore(existing_answers=[
            {
                "answer_id": "test1",
                "value": 1,
                "list_item_id": "abcdef"
            },
            {
                "answer_id": "test2",
                "value": 2,
                "list_item_id": "abcdef"
            },
            {
                "answer_id": "test3",
                "value": 3,
                "list_item_id": "xyzabc"
            },
        ])

        list_store = fake_list_store()

        questionnaire_store = MagicMock(
            spec=QuestionnaireStore,
            completed_blocks=[],
            answer_store=answer_store,
            list_store=list_store,
            progress_store=ProgressStore(),
        )

        questionnaire_store_updater = QuestionnaireStoreUpdater(
            self.location, self.schema, questionnaire_store,
            self.current_question)

        questionnaire_store_updater.remove_primary_person("people")
def test_for_list_item_ids(list_collector_block, people_answer_store,
                           people_list_store):
    schema = load_schema_from_name("test_list_collector_primary_person")

    list_context = ListContext(
        language=DEFAULT_LANGUAGE_CODE,
        progress_store=ProgressStore(),
        list_store=people_list_store,
        schema=schema,
        answer_store=people_answer_store,
        metadata=None,
    )
    list_context = list_context(
        list_collector_block["summary"],
        list_collector_block["for_list"],
        for_list_item_ids=["UHPLbX"],
    )

    expected = [{
        "item_title": "Barry Pheloung",
        "primary_person": False,
        "list_item_id": "UHPLbX",
    }]

    assert expected == list_context["list"]["list_items"]
Example #26
0
 def _deserialize(self, data):
     json_data = json.loads(data, use_decimal=True)
     self.progress_store = ProgressStore(json_data.get("PROGRESS"))
     self.set_metadata(json_data.get("METADATA", {}))
     self.answer_store = AnswerStore(json_data.get("ANSWERS"))
     self.list_store = ListStore.deserialize(json_data.get("LISTS"))
     self.collection_metadata = json_data.get("COLLECTION_METADATA", {})
    def test_routing_path_with_repeating_sections(self):
        schema = load_schema_from_name(
            "test_repeating_sections_with_hub_and_spoke")

        progress_store = ProgressStore([{
            "section_id":
            "section",
            "status":
            CompletionStatus.COMPLETED,
            "block_ids": [
                "primary-person-list-collector",
                "list-collector",
                "next-interstitial",
                "another-list-collector-block",
            ],
        }])
        path_finder = PathFinder(schema, self.answer_store, self.list_store,
                                 progress_store, self.metadata)

        repeating_section_id = "personal-details-section"
        routing_path = path_finder.routing_path(
            section_id=repeating_section_id, list_item_id="abc123")

        expected_path = RoutingPath(
            ["proxy", "date-of-birth", "confirm-dob", "sex"],
            section_id="personal-details-section",
            list_name="people",
            list_item_id="abc123",
        )

        self.assertEqual(routing_path, expected_path)
 def setUp(self):
     super().setUp()
     self.schema = load_schema_from_name("test_calculated_summary")
     answers = [
         {"value": 1, "answer_id": "first-number-answer"},
         {"value": 2, "answer_id": "second-number-answer"},
         {"value": 3, "answer_id": "second-number-answer-unit-total"},
         {"value": 4, "answer_id": "second-number-answer-also-in-total"},
         {"value": 5, "answer_id": "third-number-answer"},
         {"value": 6, "answer_id": "third-and-a-half-number-answer-unit-total"},
         {"value": "No", "answer_id": "skip-fourth-block-answer"},
         {"value": 7, "answer_id": "fourth-number-answer"},
         {"value": 8, "answer_id": "fourth-and-a-half-number-answer-also-in-total"},
         {"value": 9, "answer_id": "fifth-percent-answer"},
         {"value": 10, "answer_id": "fifth-number-answer"},
         {"value": 11, "answer_id": "sixth-percent-answer"},
         {"value": 12, "answer_id": "sixth-number-answer"},
     ]
     self.block_type = "CalculatedSummary"
     self.language = "en"
     self.metadata = {}
     self.response_metadata = {}
     self.answer_store = AnswerStore(answers)
     self.list_store = ListStore()
     self.progress_store = ProgressStore()
Example #29
0
 def setUp(self):
     super().setUp()
     self.language = "en"
     self.metadata = {}
     self.answer_store = AnswerStore()
     self.list_store = ListStore()
     self.progress_store = ProgressStore()
    def test_remove_answer_and_block_if_routing_backwards(self):
        schema = load_schema_from_name("test_confirmation_question")
        section_id = schema.get_section_id_for_block_id(
            "confirm-zero-employees-block")

        # All blocks completed
        progress_store = ProgressStore([{
            "section_id":
            "default-section",
            "list_item_id":
            None,
            "status":
            CompletionStatus.COMPLETED,
            "block_ids": [
                "number-of-employees-total-block",
                "confirm-zero-employees-block",
            ],
        }])

        answer_store = AnswerStore()
        number_of_employees_answer = Answer(
            answer_id="number-of-employees-total", value=0)
        confirm_zero_answer = Answer(answer_id="confirm-zero-employees-answer",
                                     value="No I need to change this")
        answer_store.add_or_update(number_of_employees_answer)
        answer_store.add_or_update(confirm_zero_answer)

        path_finder = PathFinder(schema, answer_store, self.list_store,
                                 progress_store, self.metadata)

        self.assertEqual(
            len(
                path_finder.progress_store.get_completed_block_ids(
                    section_id="default-section")),
            2,
        )
        self.assertEqual(len(path_finder.answer_store), 2)

        routing_path = path_finder.routing_path(section_id=section_id)

        expected_path = RoutingPath(
            [
                "number-of-employees-total-block",
                "confirm-zero-employees-block",
                "number-of-employees-total-block",
            ],
            section_id="default-section",
        )
        self.assertEqual(routing_path, expected_path)

        self.assertEqual(
            path_finder.progress_store.get_completed_block_ids(
                section_id="default-section"),
            [
                progress_store.get_completed_block_ids(
                    section_id="default-section")[0]
            ],
        )
        self.assertEqual(len(path_finder.answer_store), 1)