# Path: pyxform/xls2json.py
# SMART_QUOTES = {"\u2018": "'", "\u2019": "'", "\u201c": '"', "\u201d": '"'}
# _MSG_SUPPRESS_SPELLING = (
#     " If you do not mean to include a sheet, to suppress this message, "
#     "prefix the sheet name with an underscore. For example 'setting' "
#     "becomes '_setting'."
# )
# def print_pyobj_to_json(pyobj, path=None):
# def merge_dicts(dict_a, dict_b, default_key="default"):
# def list_to_nested_dict(lst):
# def replace_smart_quotes_in_dict(_d):
# def dealias_and_group_headers(
#     dict_array: "List[Dict]",
#     header_aliases: "Dict",
#     use_double_colons: bool,
#     default_language: str = constants.DEFAULT_LANGUAGE_VALUE,
#     ignore_case: bool = False,
# ):
# def dealias_types(dict_array):
# def clean_text_values(dict_array):
# def check_name_uniqueness(dict_array):
# def group_dictionaries_by_key(list_of_dicts, key, remove_key=True):
# def has_double_colon(workbook_dict) -> bool:
# def add_flat_annotations(prompt_list, parent_relevant="", name_prefix=""):
# def process_range_question_type(row):
# def process_image_default(default_value):
# def find_sheet_misspellings(key: str, keys: "KeysView") -> "Optional[str]":
# def workbook_to_json(
#     workbook_dict,
#     form_name=None,
#     fallback_form_name=None,
#     default_language=constants.DEFAULT_LANGUAGE_VALUE,
#     warnings=None,
# ) -> "Dict[str, Any]":
# def parse_file_to_workbook_dict(path, file_object=None):
# def get_filename(path):
# def parse_file_to_json(
#     path,
#     default_name="data",
#     default_language=constants.DEFAULT_LANGUAGE_VALUE,
#     warnings=None,
#     file_object=None,
# ):
# def organize_by_values(dict_list, key):
# def get_parameters(raw_parameters, allowed_parameters):
#     def __init__(self, path_or_file):
#     def to_json_dict(self):
#     def print_json_to_file(self, filename=""):
#     def __init__(self, path_or_file, default_name=None):
#     def print_warning_log(self, warn_out_file):
#     def __init__(self, path):
#     def _setup_question_types_dictionary(self):
#     def __init__(self, path):
#     def _organize_renames(self):
# class SpreadsheetReader:
# class SurveyReader(SpreadsheetReader):
# class QuestionTypesReader(SpreadsheetReader):
# class VariableNameReader(SpreadsheetReader):
# 
# Path: tests/utils.py
# def path_to_text_fixture(filename):
# def build_survey(filename):
# def create_survey_from_fixture(fixture_name, filetype="xls", include_directory=False):
# def prep_class_config(cls, test_dir="tests"):
# def prep_for_xml_contains(text: str) -> "Tuple[str]":
# def get_temp_file():
# def get_temp_dir():


import codecs
import os
import sys
import xml.etree.ElementTree as ETree
import pyxform
from unittest import TestCase
from formencode.doctest_xml_compare import xml_compare
from pyxform import xls2json
from tests import utils
# -*- coding: utf-8 -*-
"""
Tests by file. Runs through a list of *.xls files, and expects that the output
for a *.xml with a matching prefix before the . is as expected. Possibly risky:
all tests in this file are defined according to matching files.
"""





class MainTest(TestCase):
    def runTest(self):
        files_to_test = ["instance_xmlns_test.xls"]
        for file_to_test in files_to_test:

# Path: pyxform/xls2json.py
# SMART_QUOTES = {"\u2018": "'", "\u2019": "'", "\u201c": '"', "\u201d": '"'}
# _MSG_SUPPRESS_SPELLING = (
#     " If you do not mean to include a sheet, to suppress this message, "
#     "prefix the sheet name with an underscore. For example 'setting' "
#     "becomes '_setting'."
# )
# def print_pyobj_to_json(pyobj, path=None):
# def merge_dicts(dict_a, dict_b, default_key="default"):
# def list_to_nested_dict(lst):
# def replace_smart_quotes_in_dict(_d):
# def dealias_and_group_headers(
#     dict_array: "List[Dict]",
#     header_aliases: "Dict",
#     use_double_colons: bool,
#     default_language: str = constants.DEFAULT_LANGUAGE_VALUE,
#     ignore_case: bool = False,
# ):
# def dealias_types(dict_array):
# def clean_text_values(dict_array):
# def check_name_uniqueness(dict_array):
# def group_dictionaries_by_key(list_of_dicts, key, remove_key=True):
# def has_double_colon(workbook_dict) -> bool:
# def add_flat_annotations(prompt_list, parent_relevant="", name_prefix=""):
# def process_range_question_type(row):
# def process_image_default(default_value):
# def find_sheet_misspellings(key: str, keys: "KeysView") -> "Optional[str]":
# def workbook_to_json(
#     workbook_dict,
#     form_name=None,
#     fallback_form_name=None,
#     default_language=constants.DEFAULT_LANGUAGE_VALUE,
#     warnings=None,
# ) -> "Dict[str, Any]":
# def parse_file_to_workbook_dict(path, file_object=None):
# def get_filename(path):
# def parse_file_to_json(
#     path,
#     default_name="data",
#     default_language=constants.DEFAULT_LANGUAGE_VALUE,
#     warnings=None,
#     file_object=None,
# ):
# def organize_by_values(dict_list, key):
# def get_parameters(raw_parameters, allowed_parameters):
#     def __init__(self, path_or_file):
#     def to_json_dict(self):
#     def print_json_to_file(self, filename=""):
#     def __init__(self, path_or_file, default_name=None):
#     def print_warning_log(self, warn_out_file):
#     def __init__(self, path):
#     def _setup_question_types_dictionary(self):
#     def __init__(self, path):
#     def _organize_renames(self):
# class SpreadsheetReader:
# class SurveyReader(SpreadsheetReader):
# class QuestionTypesReader(SpreadsheetReader):
# class VariableNameReader(SpreadsheetReader):
# 
# Path: tests/utils.py
# def path_to_text_fixture(filename):
# def build_survey(filename):
# def create_survey_from_fixture(fixture_name, filetype="xls", include_directory=False):
# def prep_class_config(cls, test_dir="tests"):
# def prep_for_xml_contains(text: str) -> "Tuple[str]":
# def get_temp_file():
# def get_temp_dir():


# Path: tests/tests_by_file.py
import codecs
import os
import sys
import xml.etree.ElementTree as ETree
import pyxform
from unittest import TestCase
from formencode.doctest_xml_compare import xml_compare
from pyxform import xls2json
from tests import utils

# -*- coding: utf-8 -*-
"""
Tests by file. Runs through a list of *.xls files, and expects that the output
for a *.xml with a matching prefix before the . is as expected. Possibly risky:
all tests in this file are defined according to matching files.
"""





class MainTest(TestCase):
    def runTest(self):
        files_to_test = ["instance_xmlns_test.xls"]
        for file_to_test in files_to_test:

            path_to_excel_file = utils.path_to_text_fixture(file_to_test)