from mistool import url_use # ----------------------- # # -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent ISLINKED_FUNCTION = url_use.islinked # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ(content=THIS_DIR / 'linked.txt', mode={"keyval:: =": ":default:"}) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # ---------------- # # -- CONNECTION -- # # ---------------- #
# -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CLASS_MULTI_SPLIT = string_use.MultiSplit # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ( content = THIS_DIR / 'multisplit_iterator.txt', mode = { 'container' : ":default:", 'verbatim' : ["text", "seps", "listiter"] } ) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # --------------- #
# ----------------------- # # -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CASE_FORMATTING_FUNCTION = string_use.case # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ( content = THIS_DIR / 'case_formatting.txt', mode = {"keyval:: =": ":default:"} ) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # ------------------- # # -- CASE VARIANTS -- # # ------------------- #
# ----------------------- # THIS_DIR = StdPath(__file__).parent PPATH_CLASS = os_use.PPath # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = {} for kind in ['good', 'bad']: THE_DATAS_FOR_TESTING[kind] = READ( content = THIS_DIR / 'depth_{0}.txt'.format(kind), mode = {"keyval:: =": ":default:"} ) @fixture(scope="module") def or_datas(request): for kind in THE_DATAS_FOR_TESTING: THE_DATAS_FOR_TESTING[kind].build() def remove_extras(): for kind in THE_DATAS_FOR_TESTING: THE_DATAS_FOR_TESTING[kind].remove_extras() request.addfinalizer(remove_extras) # ----------------- #
VIRTUAL_DIR = THIS_DIR while VIRTUAL_DIR.name != "test": VIRTUAL_DIR = VIRTUAL_DIR.parent VIRTUAL_DIR /= "virtual_dir" THE_DATAS_FOR_TESTING = OrderedDict() for ppath in THIS_DIR.walk(regpath="file::**.txt"): THE_DATAS_FOR_TESTING["{0} [{1}]".format( ppath.stem, ppath.parent.stem)] = READ(content=ppath, mode={ "keyval:: =": "gene", "verbatim": ["ascii", "latex", "toc", "tree"] }) @fixture(scope="module") def or_datas(request): for name, allinfos in THE_DATAS_FOR_TESTING.items(): allinfos.build() def remove_extras(): for name, allinfos in THE_DATAS_FOR_TESTING.items(): allinfos.remove_extras() request.addfinalizer(remove_extras)
# ----------------------- # THE_DATAS_FOR_TESTING = OrderedDict() cfgdir = THIS_DIR / "default" for ppath in cfgdir.walk(regpath = "file::**.txt"): style = '{0}_{1}'.format( ppath.parent.name, ppath.stem ) THE_DATAS_FOR_TESTING[style] = READ( content = ppath, mode = { "keyval:: =": "gene", "verbatim" : ["frame", "text", "output"] } ) @fixture(scope="module") def or_datas(request): for style, allinfos in THE_DATAS_FOR_TESTING.items(): print("style :", style) allinfos.build() def remove_extras(): for style, allinfos in THE_DATAS_FOR_TESTING.items(): allinfos.remove_extras() request.addfinalizer(remove_extras)
from mistool import string_use # ----------------------- # # -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CLASS_AUTO_COMPLETE = string_use.AutoComplete # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ(content=THIS_DIR / 'autocomplete_matching.txt', mode={"verbatim": ":default:"}) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # ---------------- # # -- GOOD INPUT -- # # ---------------- #
# -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CASE_TESTING_FUNCTION = string_use.iscase # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = {} for kind in ["good", "bad"]: THE_DATAS_FOR_TESTING[kind] = READ(content=THIS_DIR / 'case_{0}.txt'.format(kind), mode={"verbatim": ":default:"}) @fixture(scope="module") def or_datas(request): for kind in THE_DATAS_FOR_TESTING: THE_DATAS_FOR_TESTING[kind].build() def remove_extras(): for kind in THE_DATAS_FOR_TESTING: THE_DATAS_FOR_TESTING[kind].remove_extras() request.addfinalizer(remove_extras)
from mistool import os_use # ----------------------- # # -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = StdPath(__file__).parent PPATH_CLASS = os_use.PPath # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ(content=THIS_DIR / 'extension_which.txt', mode={"keyval:: =": ":default:"}) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # --------------------------- # # -- EXTENSION FROM A PATH -- # # --------------------------- #
# -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent BETWEEN_FUNCTION = string_use.between # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = {} for kind in ["good", "bad"]: THE_DATAS_FOR_TESTING[kind] = READ(content=THIS_DIR / 'between_{0}.txt'.format(kind), mode="keyval:: =") @fixture(scope="module") def or_datas(request): for kind in THE_DATAS_FOR_TESTING: THE_DATAS_FOR_TESTING[kind].build() def remove_extras(): for kind in THE_DATAS_FOR_TESTING: THE_DATAS_FOR_TESTING[kind].remove_extras() request.addfinalizer(remove_extras)
# ----------------------- # # -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CLASS_MULTI_REPLACE = string_use.MultiReplace # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ(content=THIS_DIR / 'multireplace.txt', mode={ 'container': ":default:", 'verbatim': ["pattern", "before", "after"], 'keyval:: =': "oldnew" }) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # --------------- #
# -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CLASS_MULTI_SPLIT = string_use.MultiSplit # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ( content = THIS_DIR / 'multisplit_listview.txt', mode = { 'container' : ":default:", 'verbatim' : ["text", "seps", "escape", "listview"] } ) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras) # --------------- #
# ----------------------- # # -- GENERAL CONSTANTS -- # # ----------------------- # THIS_DIR = Path(__file__).parent CLASS_MULTI_REPLACE = string_use.MultiReplace # ----------------------- # # -- DATAS FOR TESTING -- # # ----------------------- # THE_DATAS_FOR_TESTING = READ(content=THIS_DIR / 'multireplace_cycle_problem.txt', mode={ 'container': ":default:", 'verbatim': "pattern", 'keyval:: =': "oldnew" }) @fixture(scope="module") def or_datas(request): THE_DATAS_FOR_TESTING.build() def remove_extras(): THE_DATAS_FOR_TESTING.remove_extras() request.addfinalizer(remove_extras)