bg VddlZddlZddlmZddlmZddlmZGddeZ dS)N)Adapter)Parser)RulescPeZdZdZeddgZdZdZdZdZ dZ d Z d S) Loaderz*Load TAP lines into unittest-able objects. diagnosticunknownc,t|_dS)N)r_parser)selfs [/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/tap/loader.py__init__zLoader.__init__sxx ctj}|D]`}tj|r|||8|||a|S)zLoad any files found into a suite. Any directories are walked and their files are added as TAP files. :returns: A ``unittest.TestSuite`` instance )unittest TestSuiteospathisdir_find_tests_in_directoryaddTestload_suite_from_file)r filessuitefilepaths r loadz Loader.loads{"$$ C CHw}}X&& C--h>>>> d77AABBBB rctj}t||}tj|s||S|j|}| ||||S)z{Load a test suite with test lines from the provided TAP file. :returns: A ``unittest.TestSuite`` instance ) rrrrrexistshandle_file_does_not_existr parse_file _load_lines)r filenamerrulesline_generators r rzLoader.load_suite_from_file s} "$$h&&w~~h''   , , . . .L00::.%GGGrctj}td|}|j}|d|||S)z}Load a test suite with test lines from the TAP stream on STDIN. :returns: A ``unittest.TestSuite`` instance stream)rrrr parse_stdinr!)r rr#r$s r load_suite_from_stdinzLoader.load_suite_from_stdin/sN "$$h&&1133.%GGGrctj|D]S\}}}|D]J}tj||}|||KTdS)z;Find test files in the directory and add them to the suite.N)rwalkrjoinrr)r directoryrdirpathdirnames filenamesr"rs r rzLoader._find_tests_in_directory9s,.GI,>,> C C (GXy% C C7<<:: d77AABBBB C C Crcd}|D]}|dz }|j|jvr|jdkr8|t|||Y|jdkr7|jr|||cS||||jdkr|||cS|jdkr| || ||S)z7Load a suite with lines produced by the line generator.rtestplanbailversion) category ignored_linesrrsaw_testskiphandle_skipping_plansaw_plan handle_bailsaw_version_atcheck)r r"r$rr# line_counterlines r r!zLoader._load_lines@s " 3 3D A L} 222}&& gh55666    &((9!..t444 LLLt\2222&((!!$''' )++$$\222 L!!! rN) __name__ __module__ __qualname____doc__setr7rrrr(rr!rr rr s44Cy122M       H H HHHHCCCrr) rr tap.adapterr tap.parserr tap.rulesrobjectrrFrr rKs OOOOOVOOOOOr