예제 #1
0
    def test_routing_basic_path(self):
        survey = load_schema_file("1_0112.json")
        expected_path = [
            "980b148e-0856-4e50-9afe-67a4fa6ae13b",
            "6c8a2f39-e0d8-406f-b463-2151225abea2",
            "0c7c8876-6a63-4251-ac29-b821b3e9b1bc",
            "a42b5752-1896-4f52-9d58-320085be92a7",
            "0b29d3f7-5905-43d8-9921-5b353db68104",
            "7e2d49eb-ffc7-4a61-a45d-eba336d1d0e6",
        ]

        navigator = Navigator(survey)
        routing_path = navigator.get_routing_path()

        self.assertEqual(routing_path, expected_path)
예제 #2
0
    def test_routing_conditional_path(self):
        survey = load_schema_file("0_star_wars.json")

        expected_path = [
            "f22b1ba4-d15f-48b8-a1f3-db62b6f34cc0",
            "96682325-47ab-41e4-a56e-8315a19ffe2a",
            "cd3b74d1-b687-4051-9634-a8f9ce10a27d",
            "an3b74d1-b687-4051-9634-a8f9ce10ard",
            "846f8514-fed2-4bd7-8fb2-4b5fcb1622b1"
        ]

        answers = {
            "ca3ce3a3-ae44-4e30-8f85-5b6a7a2fb23c": "Light Side",
            "2e0989b8-5185-4ba6-b73f-c126e3a06ba7": "No"
        }

        navigator = Navigator(survey)
        routing_path = navigator.get_routing_path(answers)

        self.assertEqual(routing_path, expected_path)
예제 #3
0
    def test_routing_basic_and_conditional_path(self):
        survey = load_schema_file("0_star_wars.json")

        expected_path = [
            "f22b1ba4-d15f-48b8-a1f3-db62b6f34cc0",
            "923ccc84-9d47-4a02-8ebc-1e9d14fcf10b",
            "26f2c4b3-28ac-4072-9f18-a6a6c6f660db",
            "cd3b74d1-b687-4051-9634-a8f9ce10a27d",
            "an3b74d1-b687-4051-9634-a8f9ce10ard",
            "846f8514-fed2-4bd7-8fb2-4b5fcb1622b1"
        ]

        answers = {
            "ca3ce3a3-ae44-4e30-8f85-5b6a7a2fb23c": "Dark Side",
            "pel989b8-5185-4ba6-b73f-c126e3a06ba7": "Can I be a pain and have a goodies ship"
        }

        navigator = Navigator(survey)
        routing_path = navigator.get_routing_path(answers)

        self.assertEqual(routing_path, expected_path)