Example #1
0
def test_main():
    test_support.run_unittest(
        OSFileTestCase, 
        OSDirTestCase,
        OSStatTestCase,
        OSWriteTestCase,
    )
def test_main():
    test_support.run_unittest(
            UnicodeDerivedCmp,
            LongDerivedCmp,
            IntStrCmp,
            CustomCmp
            )
Example #3
0
def test_main():
    with check_py3k_warnings(("exceptions must derive from BaseException",
                              DeprecationWarning),
                             ("catching classes that don't inherit "
                              "from BaseException is not allowed",
                              DeprecationWarning)):
        run_unittest(OpcodeTest)
def test_main():
    test_support.run_unittest(
        KeychainDerivationTest,
        BasicKeychainTest,
        KeychainDescendantTest,
        HighVolumeKeyDerivationTest
    )
Example #5
0
def test_main():
    test_support.run_unittest(InterfaceTest,
            TableModelTest,
            AutoSuperTest,
            PythonSubclassesTest,
            AbstractOnSyspathTest,
            ContextClassloaderTest)
Example #6
0
def test_main():
    tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
             TestExceptions, BufferIOTest, BasicTCPTest2]
    if sys.platform != 'mac':
        tests.extend([ BasicUDPTest, UDPTimeoutTest ])

    tests.extend([
        NonBlockingTCPTests,
        FileObjectClassTestCase,
        UnbufferedFileObjectClassTestCase,
        LineBufferedFileObjectClassTestCase,
        SmallBufferedFileObjectClassTestCase,
        Urllib2FileobjectTest,
        NetworkConnectionNoServer,
        NetworkConnectionAttributesTest,
        NetworkConnectionBehaviourTest,
    ])
    if hasattr(socket, "socketpair"):
        tests.append(BasicSocketPairTest)
    if sys.platform == 'linux2':
        tests.append(TestLinuxAbstractNamespace)
    if isTipcAvailable():
        tests.append(TIPCTest)
        tests.append(TIPCThreadableTest)

    thread_info = test_support.threading_setup()
    test_support.run_unittest(*tests)
    test_support.threading_cleanup(*thread_info)
def test_main():
    test_support.run_unittest(
        RoundtripLegalSyntaxTestCase,
        IllegalSyntaxTestCase,
        CompileTestCase,
        ParserStackLimitTestCase,
    )
def test_main():
    test_support.run_unittest(
        TestStringIO,
        TestcStringIO,
        TestBufferStringIO,
        TestBuffercStringIO
    )
def test_main(verbose=None):
    NamedTupleDocs = doctest.DocTestSuite(module=collections)
    test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
                    TestCollectionABCs, TestCounter,
                    TestOrderedDict, GeneralMappingTests, SubclassMappingTests]
    test_support.run_unittest(*test_classes)
    test_support.run_doctest(collections, verbose)
Example #10
0
def test_main():
    run_unittest(FailureTestCase, NonexceptionalTestCase,
                 NestedNonexceptionalTestCase, ExceptionalTestCase,
                 NonLocalFlowControlTestCase,
                 AssignmentTargetTestCase,
                 ExitSwallowsExceptionTestCase,
                 NewKeywordsWarningTestCase)
Example #11
0
def test_main(verbose=None):
    import doctest
    from test import test_sets
    test_support.run_unittest(
        TestSetOfSets,
        TestExceptionPropagation,
        TestBasicOpsEmpty,
        TestBasicOpsSingleton,
        TestBasicOpsTuple,
        TestBasicOpsTriple,
        TestBinaryOps,
        TestUpdateOps,
        TestMutate,
        TestSubsetEqualEmpty,
        TestSubsetEqualNonEmpty,
        TestSubsetEmptyNonEmpty,
        TestSubsetPartial,
        TestSubsetNonOverlap,
        TestOnlySetsNumeric,
        TestOnlySetsDict,
        TestOnlySetsOperator,
        TestOnlySetsTuple,
        TestOnlySetsString,
        TestOnlySetsGenerator,
        TestOnlySetsofSets,
        TestCopyingEmpty,
        TestCopyingSingleton,
        TestCopyingTriple,
        TestCopyingTuple,
        TestCopyingNested,
        TestIdentities,
        doctest.DocTestSuite(test_sets),
    )
Example #12
0
def test_main():
    test_support.requires('network')
    with test_support.check_py3k_warnings(
            ("urllib.urlopen.. has been removed", DeprecationWarning)):
        test_support.run_unittest(URLTimeoutTest,
                                  urlopenNetworkTests,
                                  urlretrieveNetworkTests)
def test_main():
    test_support.run_unittest(TestDescrTestCase,
                              SubclassDescrTestCase,
                              InPlaceTestCase,
                              DescrExceptionsTestCase,
                              GetAttrTestCase,
                              BinopCombinationsTestCase)
Example #14
0
def test_main():
    tests = [TestPOP3Class, TestTimeouts, TestPOP3_SSLClass]
    thread_info = test_support.threading_setup()
    try:
        test_support.run_unittest(*tests)
    finally:
        test_support.threading_cleanup(*thread_info)
Example #15
0
def test_main():
    test_support.requires("network")
    test_support.run_unittest(AuthTests,
                              OtherNetworkTests,
                              CloseSocketTest,
                              TimeoutTest,
                              )
def test_main(verbose=None):
    test_support.run_unittest(
        TestBTree,
        TestHashTable,
        TestBTree_InMemory,
        TestHashTable_InMemory,
    )
Example #17
0
def test_main():
    run_unittest(
        ChecksumTestCase,
        ExceptionTestCase,
        CompressTestCase,
        CompressObjectTestCase
    )
def test_main():
    test_support.run_unittest(
        TerminationAndSignalTest,
        PidTest,
        EnvironmentInheritanceTest,
        JythonOptsTest,
        Cmdline2ListTestCase)
Example #19
0
def test_main():
    test_support.run_unittest(
        TestVectorsTestCase,
        ConstructorTestCase,
        SanityTestCase,
        CopyTestCase
    )
Example #20
0
def test_main():
    tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
             DispatcherWithSendTests_UsePoll]
    if hasattr(asyncore, 'file_wrapper'):
        tests.append(FileWrapperTest)

    run_unittest(*tests)
Example #21
0
def test_main():
    test_support.run_unittest(
        TemporaryFileTests,
        StatAttributeTests,
        EnvironTests,
        WalkTests
    )
Example #22
0
def test_main(verbose=False):
    if skip_expected:
        raise test_support.TestSkipped("No SSL support")

    global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT
    CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem")
    SVN_PYTHON_ORG_ROOT_CERT = os.path.join(os.path.dirname(__file__) or os.curdir, "https_svn_python_org_root.pem")

    if not os.path.exists(CERTFILE) or not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT):
        raise test_support.TestFailed("Can't read certificate files!")

    TESTPORT = test_support.find_unused_port()
    if not TESTPORT:
        raise test_support.TestFailed("Can't find open port to test servers on!")

    tests = [BasicTests]

    if test_support.is_resource_enabled("network"):
        tests.append(NetworkedTests)

    if _have_threads:
        thread_info = test_support.threading_setup()
        if thread_info and test_support.is_resource_enabled("network"):
            tests.append(ThreadedTests)

    test_support.run_unittest(*tests)

    if _have_threads:
        test_support.threading_cleanup(*thread_info)
Example #23
0
def test_main():
    test_support.run_unittest(
        PickleTests,
        PicklerTests,
        PersPicklerTests
    )
    test_support.run_doctest(pickle)
Example #24
0
def test_main():
    run_unittest(MakeParserTest,
                 SaxutilsTest,
                 XmlgenTest,
                 ExpatReaderTest,
                 ErrorReportingTest,
                 XmlReaderTest)
Example #25
0
def test_main():
    test_support.run_unittest(
        OutputTestCase,
        CalendarTestCase,
        MondayTestCase,
        SundayTestCase
    )
Example #26
0
def test_main(verbose=None):
    from test import test_urllib2

    test_support.run_doctest(test_urllib2, verbose)
    test_support.run_doctest(urllib2, verbose)
    tests = (TrivialTests, OpenerDirectorTests, HandlerTests, MiscTests, RequestTests)
    test_support.run_unittest(*tests)
Example #27
0
def test_main():
    test_support.run_unittest(
        cPickleTests,
        cPicklePicklerTests,
        cPickleListPicklerTests,
        cPickleFastPicklerTests
    )
def test_main():
    test_support.run_unittest(
        BZ2FileTest,
        BZ2CompressorTest,
        BZ2DecompressorTest,
        FuncTest
    )
Example #29
0
def test_main():
    tests = [
                ChdirTestCase,
                ImportTestCase,
                ImportPackageTestCase,
                ZipimportTestCase,
                PyCompileTestCase,
                ExecfileTestCase,
                ExecfileTracebackTestCase,
                ListdirTestCase,
                DirsTestCase,
                FilesTestCase,
                SymlinkTestCase
            ]
    if WINDOWS:
        tests.append(WindowsChdirTestCase)
        tests.remove(SymlinkTestCase)       #  os.symlink ... Availability: Unix.

    if test_support.is_jython:
        tests.extend((ImportJavaClassTestCase,
                      ImportJarTestCase))
 
    if test_support.is_resource_enabled('subprocess'):
        tests.append(SubprocessTestCase)

    test_support.run_unittest(*tests)
Example #30
0
def test_main():
    if gzip:
        # create testtar.tar.gz
        gzip.open(tarname("gz"), "wb").write(file(tarname(), "rb").read())
    if bz2:
        # create testtar.tar.bz2
        bz2.BZ2File(tarname("bz2"), "wb").write(file(tarname(), "rb").read())

    tests = [FileModeTest, ReadTest, ReadStreamTest, WriteTest, WriteSize0Test, WriteStreamTest, WriteGNULongTest]

    if hasattr(os, "link"):
        tests.append(ExtractHardlinkTest)
        tests.append(CreateHardlinkTest)

    if gzip:
        tests.extend([ReadTestGzip, ReadStreamTestGzip, WriteTestGzip, WriteStreamTestGzip])

    if bz2:
        tests.extend([ReadTestBzip2, ReadStreamTestBzip2, WriteTestBzip2, WriteStreamTestBzip2])
    try:
        test_support.run_unittest(*tests)
    finally:
        if gzip:
            os.remove(tarname("gz"))
        if bz2:
            os.remove(tarname("bz2"))
        if os.path.exists(dirname()):
            shutil.rmtree(dirname())
        if os.path.exists(tmpname()):
            os.remove(tmpname())
Example #31
0
def test_main():
    test_support.run_unittest(BZ2FileTest, BZ2CompressorTest,
                              BZ2DecompressorTest, FuncTest)
    test_support.reap_children()
Example #32
0
def test_main():
    test_support.run_unittest(SysTest, ShadowingTest, SyspathResourceTest,
                              SyspathUnicodeTest, SysEncodingTest, SysArgvTest,
                              InteractivePromptTest)
def test_main():
    run_unittest(TracebackCases, TracebackFormatTests)
Example #34
0
def test_main():
    test_support.run_unittest(EOFTestCase)
def test_main():
    test_support.run_unittest(TestPlistlib)
    def test_cp20302(self):
        import _codecs
        for encoding in ip_supported_encodings:
            if encoding.lower() in ['cp1252']: #http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=20302
                continue
            temp = _codecs.lookup(encoding)

    def test_charmap_build(self):
        decodemap = ''.join([unichr(i).upper() if chr(i).islower() else unichr(i).lower() for i in xrange(256)])
        encodemap = codecs.charmap_build(decodemap)
        self.assertEqual(codecs.charmap_decode(u'Hello World', 'strict', decodemap), ('hELLO wORLD', 11))
        self.assertEqual(codecs.charmap_encode(u'Hello World', 'strict', encodemap), ('hELLO wORLD', 11))

    def test_gh16(self):
        """https://github.com/IronLanguages/ironpython2/issues/16"""
        # test with a standard error handler
        res = u"\xac\u1234\u20ac\u8000".encode("rot_13", "backslashreplace")
        self.assertEqual(res, "\xac\\h1234\\h20np\\h8000")

        # test with a custom error handler
        def handler(ex):
            return (u"", ex.end)
        codecs.register_error("test_unicode_error", handler)
        res = u"\xac\u1234\u20ac\u8000".encode("rot_13", "test_unicode_error")
        self.assertEqual(res, "\xac")
    
if __name__ == '__main__':
    from test import test_support
    test_support.run_unittest(__name__)
def test_main():
    run_unittest(CodeopTests)
Example #38
0
def test_main():
    test_support.run_unittest(StringprepTests)
Example #39
0
def test_main():
    run_unittest(BufferSizesTests, FileInputTests, Test_hook_encoded)
Example #40
0
def test_main():
    run_unittest(Wait4Test)
    reap_children()
Example #41
0
def test_main():
    test_support.run_unittest(TestSpecifics)
Example #42
0
def test_main():
    support.run_unittest(getlang_Tests, LocaleTime_Tests, TimeRETests,
                         StrptimeTests, Strptime12AMPMTests, JulianTests,
                         CalculationTests, CacheTests)
Example #43
0
def test_main():
    run_unittest(AifcPCM8Test, AifcPCM16Test, AifcPCM16Test, AifcPCM24Test,
                 AifcPCM32Test, AifcULAWTest,
                 AifcMiscTest, AIFCLowLevelTest)
Example #44
0
def test_main():
    test_support.run_unittest(GroupDatabaseTestCase)
def test_main():
    run_unittest(Popen2Test)
Example #46
0
def test_main():
    test_support.run_unittest(HTMLParserTestCase)
Example #47
0
def test_main():
    test_support.run_unittest(TestPrint)
Example #48
0
def test_main():
    with test_support.check_py3k_warnings(
        ("tuple parameter unpacking has been removed", SyntaxWarning),
        ("parenthesized argument names are invalid", SyntaxWarning)):
        test_support.run_unittest(ComplexArgsTestCase)
Example #49
0
def test_main():
    tests = [
        t for t in globals().values()
        if isinstance(t, type) and issubclass(t, unittest.TestCase)
    ]
    test_support.run_unittest(*tests)
def test_main():
    test_support.run_unittest(TestDecorators)
def test_main():
    distutils.log.set_threshold(distutils.log.WARN)
    test_support.run_unittest(ModuleFinderTest)
Example #52
0
def test_main():
    run_unittest(ForkTest)
    reap_children()
Example #53
0
def test_main():
    mod = sys.modules[__name__]
    test_support.run_unittest(
        *[getattr(mod, name) for name in dir(mod) if name.startswith('Test')])
Example #54
0
def test_main():
    test_support.run_unittest(StrTest)
Example #55
0
def test_main(verbose=None):
    test_support.run_unittest(GeneralTests, ReadTests, OptionTests)
Example #56
0
def test_main():
    test_support.run_unittest(__name__)
def test_main():
    test_support.run_unittest(TestCopy)
Example #58
0
def test_main():
    test_support.run_unittest(SymtableTest)
Example #59
0
        write_script("script2.py", ("#!/usr/bin/python\n"
                                    "# bogus script w/ Python sh-bang\n"
                                    "pass\n"))
        write_script("shell.sh", ("#!/bin/sh\n"
                                  "# bogus shell script w/ sh-bang\n"
                                  "exit 0\n"))

        target = self.mkdtemp()
        dist = Distribution()
        dist.command_obj["build"] = support.DummyCommand(build_scripts=source)
        dist.command_obj["install"] = support.DummyCommand(
            install_scripts=target,
            force=1,
            skip_build=1,
        )
        cmd = install_scripts(dist)
        cmd.finalize_options()
        cmd.run()

        installed = os.listdir(target)
        for name in expected:
            self.assertIn(name, installed)


def test_suite():
    return unittest.makeSuite(InstallScriptsTestCase)


if __name__ == "__main__":
    run_unittest(test_suite())
Example #60
0
def test_main():
    test_support.run_unittest(ThreadRunningTests, BarrierTest)