404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.144.172.231: ~ $
import sys
import tempfile
from unittest.runner import TextTestResult

from tap.directive import Directive
from tap.line import Bail, Plan, Result


class Factory(object):
    """A factory to produce commonly needed objects"""

    def make_ok(self, directive_text=""):
        return Result(True, 1, "This is a description.", Directive(directive_text))

    def make_not_ok(self, directive_text=""):
        return Result(False, 1, "This is a description.", Directive(directive_text))

    def make_bail(self, reason="Because it is busted."):
        return Bail(reason)

    def make_plan(self, expected_tests=99, directive_text=""):
        return Plan(expected_tests, Directive(directive_text))

    def make_test_result(self):
        stream = tempfile.TemporaryFile(mode="w")
        return TextTestResult(stream, None, 1)

    def make_exc(self):
        """Make a traceback tuple.

        Doing this intentionally is not straight forward.
        """
        try:
            raise ValueError("boom")
        except ValueError:
            return sys.exc_info()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 71 B 0644
factory.py File 1.05 KB 0644
run.py File 456 B 0644
test_adapter.py File 1.84 KB 0644
test_directive.py File 1.2 KB 0644
test_formatter.py File 601 B 0644
test_line.py File 1.2 KB 0644
test_loader.py File 3.66 KB 0644
test_main.py File 1.96 KB 0644
test_parser.py File 16.24 KB 0644
test_result.py File 3.4 KB 0644
test_rules.py File 2.81 KB 0644
test_runner.py File 3.32 KB 0644
test_tracker.py File 10.91 KB 0644
testcase.py File 222 B 0644