403Webshell
Server IP : 123.56.80.60  /  Your IP : 216.73.216.78
Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev
System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586
User : SYSTEM ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files/python/Lib/site-packages/win32ctypes/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/python/Lib/site-packages/win32ctypes/tests/compat.py
import sys

__all__ = ['TestCase']

if sys.version_info[:2] == (2, 6):
    import contextlib
    from unittest import TestCase as BaseTestCase

    class SkipException(Exception):
        pass

    class ExceptionContext(object):

        def __init__(self):
            self.exception = None

    class TestCase(BaseTestCase):

        def assertIs(self, a, b):
            self.assertTrue(a is b)

        def assertIsNot(self, a, b):
            self.assertTrue(a is not b)

        def assertIsNone(self, a):
            self.assertTrue(a is None)

        def assertIsNotNone(self, a):
            self.assertTrue(a is not None)

        def assertIn(self, a, b):
            self.assertTrue(a in b)

        def assertNotIn(self, a, b):
            self.assertTrue(a not in b)

        def assertIsInstance(self, a, b):
            self.assertTrue(isinstance(a, b))

        def assertNotIsInstance(self, a, b):
            self.assertTrue(not isinstance(a, b))

        def assertSequenceEqual(self, a, b, msg=None, seq_type=None):
            return self.assertEqual(tuple(a), tuple(b), msg=msg)

        def assertMultiLineEqual(self, a, b, msg=None):
            return self.assertEqual(a, b, msg=msg)

        def assertGreater(self, a, b, msg=None):
            return self.assertTrue(a > b, msg=msg)

        @contextlib.contextmanager
        def failUnlessRaises(self, error, *args):
            context = ExceptionContext()
            if len(args) == 0:
                try:
                    yield context
                except error as exception:
                    context.exception = exception
                else:
                    self.fail('{0} was not raised'.format(error))
            else:
                super(TestCase, self).failUnlessRaises(error, *args)
        assertRaises = failUnlessRaises

        def run(self, result=None):
            BaseTestCase.run(self, result)
            if result is not None:
                errors = result.errors
                skip_error = (
                    'in skipTest\n    raise SkipException(msg)')
                result.errors = []
                for error in errors:
                    if skip_error in error[1]:
                        print ('Skipped')
                    else:
                        result.errors.append(error)
            return result

        def skipTest(self, msg):
            raise SkipException(msg)

else:
    from unittest import TestCase

Youez - 2016 - github.com/yon3zu
LinuXploit