Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > site-packages > tap
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
tests | Directory | - | - | |
__init__.py | File | 85 bytes | April 17 2025 13:10:58. | |
__main__.py | File | 48 bytes | April 17 2025 13:10:58. | |
adapter.py | File | 1509 bytes | April 17 2025 13:10:58. | |
directive.py | File | 1791 bytes | April 17 2025 13:10:58. | |
formatter.py | File | 762 bytes | April 17 2025 13:10:58. | |
line.py | File | 4673 bytes | April 17 2025 13:10:58. | |
loader.py | File | 2943 bytes | April 17 2025 13:10:58. | |
main.py | File | 2124 bytes | April 17 2025 13:10:58. | |
parser.py | File | 6787 bytes | April 17 2025 13:10:58. | |
rules.py | File | 3378 bytes | April 17 2025 13:10:58. | |
runner.py | File | 5066 bytes | April 17 2025 13:10:58. | |
tracker.py | File | 7576 bytes | April 17 2025 13:10:58. |
import os import unittest from tap.adapter import Adapter from tap.parser import Parser from tap.rules import Rules class Loader: """Load TAP lines into unittest-able objects.""" ignored_lines = set(["diagnostic", "unknown"]) def __init__(self): self._parser = Parser() def load(self, files): """Load any files found into a suite. Any directories are walked and their files are added as TAP files. :returns: A ``unittest.TestSuite`` instance """ suite = unittest.TestSuite() for filepath in files: if os.path.isdir(filepath): self._find_tests_in_directory(filepath, suite) else: suite.addTest(self.load_suite_from_file(filepath)) return suite def load_suite_from_file(self, filename): """Load a test suite with test lines from the provided TAP file. :returns: A ``unittest.TestSuite`` instance """ suite = unittest.TestSuite() rules = Rules(filename, suite) if not os.path.exists(filename): rules.handle_file_does_not_exist() return suite line_generator = self._parser.parse_file(filename) return self._load_lines(filename, line_generator, suite, rules) def load_suite_from_stdin(self): """Load a test suite with test lines from the TAP stream on STDIN. :returns: A ``unittest.TestSuite`` instance """ suite = unittest.TestSuite() rules = Rules("stream", suite) line_generator = self._parser.parse_stdin() return self._load_lines("stream", line_generator, suite, rules) def _find_tests_in_directory(self, directory, suite): """Find test files in the directory and add them to the suite.""" for dirpath, _dirnames, filenames in os.walk(directory): for filename in filenames: filepath = os.path.join(dirpath, filename) suite.addTest(self.load_suite_from_file(filepath)) def _load_lines(self, filename, line_generator, suite, rules): """Load a suite with lines produced by the line generator.""" line_counter = 0 for line in line_generator: line_counter += 1 if line.category in self.ignored_lines: continue if line.category == "test": suite.addTest(Adapter(filename, line)) rules.saw_test() elif line.category == "plan": if line.skip: rules.handle_skipping_plan(line) return suite rules.saw_plan(line, line_counter) elif line.category == "bail": rules.handle_bail(line) return suite elif line.category == "version": rules.saw_version_at(line_counter) rules.check(line_counter) return suite
SILENT KILLER Tool