# encoding: utf-8
"""
The data type and use of it for declaratively creating test courses.
"""
# used to create course subtrees in ModuleStoreTestCase.create_test_course
# adds to self properties w/ the given block_id which hold the UsageKey for easy retrieval.
# fields is a dictionary of keys and values. sub_tree is a collection of BlockInfo
from collections import namedtuple

BlockInfo = namedtuple('BlockInfo', 'block_id, category, fields, sub_tree')
default_block_info_tree = [  # pylint: disable=invalid-name
    BlockInfo(
        'chapter_x', 'chapter', {}, [
            BlockInfo(
                'sequential_x1', 'sequential', {}, [
                    BlockInfo(
                        'vertical_x1a', 'vertical', {}, [
                            BlockInfo('problem_x1a_1', 'problem', {}, []),
                            BlockInfo('problem_x1a_2', 'problem', {}, []),
                            BlockInfo('problem_x1a_3', 'problem', {}, []),
                            BlockInfo('html_x1a_1', 'html', {}, []),
                        ]
                    )
                ]
            )
        ]
    ),
    BlockInfo(
        'chapter_y', 'chapter', {}, [
            BlockInfo(
                'sequential_y1', 'sequential', {}, [
                    BlockInfo(
                        'vertical_y1a', 'vertical', {}, [
                            BlockInfo('problem_y1a_1', 'problem', {}, []),
                            BlockInfo('problem_y1a_2', 'problem', {}, []),
                            BlockInfo('problem_y1a_3', 'problem', {}, []),
                        ]
                    )
                ]
            )
        ]
    )
]
