# Tests for the qdf parser

from qdf import QuestionDefinitions


def main():
    qdef = QuestionDefinitions()
    qdef.parse_qdf("example_qdf/sh.qdf")
    print(qdef.entries_datafile["C_01"].qps_type)
    print(qdef.entries_datafile["C_01"].text)
    print(qdef.entries_datafile["C_01"].instructions)
    print(qdef.entries_datafile["P4A"].qps_type)
    print(qdef.entries_datafile["P4A"].pandas_type)
    print(qdef.entries_datafile["P4A"].max_sel)

    print(qdef.entries_datafile["P1A"].start)
    print(qdef.entries_datafile["P1A"].size)
    print(qdef.entries_datafile["P1A"].max_sel)
    print(qdef.entries_datafile["P1A"].responses)
    print(qdef.entries_datafile[qdef.entries[2]].size)
    df = qdef.read_data("example_qdf/sh.asc")
    print(df["ZZZSECSM"])

if __name__ == "__main__":
    main()
