• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python common.verbosePrint函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tables.tests.common.verbosePrint函数的典型用法代码示例。如果您正苦于以下问题:Python verbosePrint函数的具体用法?Python verbosePrint怎么用?Python verbosePrint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了verbosePrint函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: testDescrStructure

    def testDescrStructure(self):
        """Check structure of the descr list.
        """

        common.verbosePrint('\nTesting descr structure')
        for item in nriterators.flattenDescr(self.descr, check=True):
            self.failIfEqual(item, None)
开发者ID:andreas-h,项目名称:PyTables,代码行数:7,代码来源:test_nriterators.py


示例2: testNamesStructure

    def testNamesStructure(self):
        """Check the structure of the names list.
        """

        common.verbosePrint('\nTesting names structure')
        for item in nriterators.flattenNames(self.names):
            self.failIfEqual(item, None)
开发者ID:andreas-h,项目名称:PyTables,代码行数:7,代码来源:test_nriterators.py


示例3: testSubFieldNames

    def testSubFieldNames(self):
        """Check the syntax of the names list components.
        """

        common.verbosePrint('\nTesting names list decomposition')
        subnames = [sn for sn in nriterators.getSubNames(self.names)]
        self.assertEqual(subnames, self.subnames)
开发者ID:andreas-h,项目名称:PyTables,代码行数:7,代码来源:test_nriterators.py


示例4: testFormatsStructure

    def testFormatsStructure(self):
        """Check the structure of the formats list.
        """

        common.verbosePrint('\nTesting formats structure')
        for f in nriterators.flattenFormats(self.formats, check=True):
            self.failIfEqual(f, None)
开发者ID:andreas-h,项目名称:PyTables,代码行数:7,代码来源:test_nriterators.py


示例5: test01_rowAppend

    def test01_rowAppend(self):
        """Appending enumerated values using ``row.append()``."""

        tbl = self.h5file.createTable(
            '/', 'test', self._description(), title=self._getMethodName())

        appended = [
            (10, self.valueInEnum),
            (20, self.valueOutOfEnum)]

        row = tbl.row

        row['rid'] = appended[0][0]
        row['rcolor'] = appended[0][1]
        row.append()

        row['rid'] = appended[1][0]
        self.assertRaises(
            ValueError, operator.setitem, row, 'rcolor', appended[1][1])

        tbl.flush()
        tbl.flavor = 'python'
        read = tbl.read()
        common.verbosePrint(
            "* appended value: %s\n"
            "* read value: %s\n"
            % (appended[:-1], read) )
        self.assertEqual(
            appended[:-1], read, "Written and read values differ.")
开发者ID:ilustreous,项目名称:PyTables,代码行数:29,代码来源:test_enum.py


示例6: testBufferStructureWDescr

    def testBufferStructureWDescr(self):
        """Check the structure of a buffer row using the descr list.
        """

        common.verbosePrint('\nTesting buffer row structure with zipBufferDescr')
        mix = [item for item in nriterators.zipBufferDescr(self.row,
            self.descr)]
        self.assertEqual(mix, zip(self.flat_row, self.flat_formats))
开发者ID:andreas-h,项目名称:PyTables,代码行数:8,代码来源:test_nriterators.py


示例7: testNamesFromDescr

    def testNamesFromDescr(self):
        """Retrieves the names list from the descr list.
        """

        # Check getNamesFromDescr function
        common.verbosePrint('\nTesting getNamesFromDescr function')
        new_names = \
            [item for item in nriterators.getNamesFromDescr(self.descr)]
        self.assertEqual(self.names, new_names)
开发者ID:andreas-h,项目名称:PyTables,代码行数:9,代码来源:test_nriterators.py


示例8: testMakeDescr

    def testMakeDescr(self):
        """Check the generation of a descr from formats and names.
        """

        common.verbosePrint('\nTesting getDescr function')
        mix = [f for f in nriterators.getDescr(None, self.formats)]
        self.assertEqual(mix, self.autoNamedDescr)
        mix = \
            [f for f in nriterators.getDescr(self.names, self.formats)]
        self.assertEqual(mix, self.descr)
开发者ID:andreas-h,项目名称:PyTables,代码行数:10,代码来源:test_nriterators.py


示例9: testFieldsDescr

    def testFieldsDescr(self):
        """Check the checkFieldsInDescr function.
        """

        common.verbosePrint( """\nTesting the field names syntax in a """
            """sample descr list""")
        descr = [('position', 'Int64'),
            ('info', [('name', [('first','a5'), ('second','a5')]),
               ('coord', [('x/equis','Float32'), ('y', 'f4'), ('z', 'f4')])])]
        self.assertRaises(ValueError, nra.nestedrecords._checkFieldsInDescr,
            descr)
开发者ID:87,项目名称:PyTables,代码行数:11,代码来源:test_nestedrecords.py


示例10: newmethod

 def newmethod(self, *args, **kwargs):
     self._verboseHeader()
     try:
         return oldmethod(self, *args, **kwargs)
     except SilentlySkipTest as se:
         if se.args:
             msg = se.args[0]
         else:
             msg = "<skipped>"
         common.verbosePrint("\nSkipped test: %s" % msg)
     finally:
         common.verbosePrint('')  # separator line between tests
开发者ID:dpritsos,项目名称:DoGSWrapper,代码行数:12,代码来源:test_queries.py


示例11: test02_append

    def test02_append(self):
        """Appending enumerated values using ``table.append()``."""

        tbl = self.h5file.create_table("/", "test", self._description(), title=self._getMethodName())

        appended = [(10, self.valueInEnum), (20, self.valueOutOfEnum)]

        tbl.append(appended)
        tbl.flush()
        tbl.flavor = "python"
        read = tbl.read()
        common.verbosePrint("* appended value: %s\n" "* read value: %s\n" % (appended, read))
        self.assertEqual(appended, read, "Written and read values differ.")
开发者ID:PyTables,项目名称:PyTables,代码行数:13,代码来源:test_enum.py


示例12: testArrayUniqueSyntax

    def testArrayUniqueSyntax(self):
        """Check the onlyOneSyntax function.
        """

        common.verbosePrint( '\nTesting the uniqueness of the array syntax')
        self.assertEqual(nra.nestedrecords._onlyOneSyntax(self.descr, None,
            None), None)
        self.assertEqual(nra.nestedrecords._onlyOneSyntax(None,
            self.formats, None), None)
        self.assertRaises(ValueError, nra.nestedrecords._onlyOneSyntax,
            self.descr, self.formats, None)
        self.assertRaises(ValueError, nra.nestedrecords._onlyOneSyntax,
            self.descr, None, self.names)
开发者ID:87,项目名称:PyTables,代码行数:13,代码来源:test_nestedrecords.py


示例13: test03_setitem

    def test03_setitem(self):
        """Changing enumerated values using ``vlarray.__setitem__()``."""

        vlarr = self.h5file.create_vlarray("/", "test", self._atom(), title=self._getMethodName())
        vlarr.flavor = "python"

        appended = (self.valueInEnum, self.valueInEnum)
        vlarr.append(appended)

        written = [self.valueInEnum, self.valueOutOfEnum]
        vlarr[0] = written
        read = vlarr.read()
        common.verbosePrint("* written value: %s\n" "* read value: %s\n" % (written, read))
        self.assertEqual(written, read[0], "Written and read values differ.")
开发者ID:PyTables,项目名称:PyTables,代码行数:14,代码来源:test_enum.py


示例14: test01_append

    def test01_append(self):
        """Appending scalar elements of enumerated values."""

        vlarr = self.h5file.create_vlarray("/", "test", self._atom(), title=self._getMethodName())
        vlarr.flavor = "python"

        appended = [[self.valueInEnum], [self.valueInEnum, self.valueOutOfEnum]]

        vlarr.append(appended[0])
        vlarr.append(appended[1])
        vlarr.flush()
        read = vlarr.read()
        common.verbosePrint("* appended value: %s\n" "* read value: %s\n" % (appended, read))
        self.assertEqual(appended, read, "Written and read values differ.")
开发者ID:PyTables,项目名称:PyTables,代码行数:14,代码来源:test_enum.py


示例15: test

    def test(self):
        """Reading scalar arrays (see #98)."""

        arr = self.h5file.createArray('/', 'scalar_na', 1234)
        arr.flavor = 'numarray'

        self._reopen()

        arr = self.h5file.root.scalar_na

        common.verbosePrint("* %r == %r ?" % (arr.read(), array(1234)))
        self.assertTrue(all(arr.read() == array(1234)))
        common.verbosePrint("* %r == %r ?" % (arr[()], array(1234)))
        self.assertTrue(all(arr[()] == 1234))
开发者ID:andreas-h,项目名称:PyTables,代码行数:14,代码来源:test_numarray.py


示例16: testArrayFormats

    def testArrayFormats(self):
        """Check the checkFormats function.
        """

        common.verbosePrint( '\nTesting samples of formats description')
        formats = 'formats should be a list'
        self.assertRaises(TypeError, nra.nestedrecords._checkFormats,
            formats)
        # Formats must be a list of strings or sequences
        formats = [25,
            [['a5', 'a5'],['Float32', 'f4', 'f4']]]
        self.assertRaises(TypeError, nra.nestedrecords._checkFormats,
            formats)
        # If formats is OK checkFormats returns None
        self.assertEqual(nra.nestedrecords._checkFormats(self.formats),
            None)
开发者ID:87,项目名称:PyTables,代码行数:16,代码来源:test_nestedrecords.py


示例17: test05_where

    def test05_where(self):
        """Searching enumerated data."""

        tbl = self.h5file.create_table("/", "test", self._description(), title=self._getMethodName())

        appended = [(10, self.valueInEnum), (20, self.valueInEnum), (30, self.valueOutOfEnum)]
        tbl.append(appended)
        tbl.flush()

        searched = [(row["rid"], row["rcolor"]) for row in tbl.where("rcolor == v", {"v": self.valueInEnum})]
        common.verbosePrint(
            "* ``valueInEnum``: %s\n"
            "* ``rcolor`` column: ``%s``\n"
            "* ``searched``: %s\n"
            "* Should look like: %s\n" % (self.valueInEnum, tbl.cols.rcolor, searched, appended[:-1])
        )
        self.assertEqual(searched, appended[:-1], "Search returned incorrect results.")
开发者ID:PyTables,项目名称:PyTables,代码行数:17,代码来源:test_enum.py


示例18: test02_appendMD

    def test02_appendMD(self):
        """Appending multi-dimensional elements of enumerated values."""

        vlarr = self.h5file.createVLArray(
            '/', 'test', self._atom((2,)),
            title=self._getMethodName() )
        vlarr.flavor = 'python'

        appended = [
            [[self.valueInEnum, self.valueInEnum],],
            [[self.valueInEnum, self.valueOutOfEnum],
             [self.valueInEnum, self.valueInEnum]]]

        vlarr.append(appended[0])
        vlarr.append(appended[1])
        vlarr.flush()
        read = vlarr.read()
        common.verbosePrint(
            "* appended value: %s\n"
            "* read value: %s\n"
            % (appended, read) )
        self.assertEqual(appended, read, "Written and read values differ.")
开发者ID:ilustreous,项目名称:PyTables,代码行数:22,代码来源:test_enum.py


示例19: testArrayNames

    def testArrayNames(self):
        """Check the checkNames function.
        """

        common.verbosePrint( '\nTesting samples of names description')
        names = 'names should be a list'
        self.assertRaises(TypeError, nra.nestedrecords._checkNames,
            names)
        # Names must be a list of strings or 2-tuples
        names = [25,
            ('info', [('name', ['first', 'second']),
                                ('coord', ['x', 'y', 'z'])])]
        self.assertRaises(TypeError, nra.nestedrecords._checkNames, names)

        # Names must be unique at any given level
        names = ['position',
            ('info', [('name', ['first', 'second']),
                                ('coord', ['x', 'y', 'y'])])]
        self.assertRaises(ValueError, nra.nestedrecords._checkNames, names)

        # If names is OK checkNames returns None
        self.assertEqual(nra.nestedrecords._checkNames(self.names), None)
开发者ID:87,项目名称:PyTables,代码行数:22,代码来源:test_nestedrecords.py


示例20: testNamesUniqueness

    def testNamesUniqueness(self):
        """Check that names are unique at every level of the names list.
        """

        common.verbosePrint('\nTesting checkNamesUniqueness')
        foo = nriterators.checkNamesUniqueness
        badNames = ['info',
        ('info', [('name', ['first', 'second']),
                                ('coord', ['x', 'y', 'z'])])]
        self.assertRaises(ValueError, foo, badNames)
        badNames = ['position',
        ('info', [('coord', ['first', 'second']),
                                ('coord', ['x', 'y', 'z'])])]
        self.assertRaises(ValueError, foo, badNames)
        badNames = ['position',
        ('info', [('name', ['first', 'second']),
                                ('coord', ['x', 'x', 'z'])])]
        self.assertRaises(ValueError, foo, badNames)
        goodNames = ['position',
        ('info', [('info', ['first', 'second']),
                                ('coord', ['x', 'y', 'z'])])]
        self.assertEqual(foo(goodNames), None)
开发者ID:andreas-h,项目名称:PyTables,代码行数:22,代码来源:test_nriterators.py



注:本文中的tables.tests.common.verbosePrint函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tablet.kill_tablets函数代码示例发布时间:2022-05-27
下一篇:
Python common.areArraysEqual函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap