本文整理汇总了Python中tables.tests.common.verbosePrint函数的典型用法代码示例。如果您正苦于以下问题:Python verbosePrint函数的具体用法?Python verbosePrint怎么用?Python verbosePrint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verbosePrint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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)
示例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.")
示例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))
示例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)
示例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)
示例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)
示例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
示例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.")
示例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)
示例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.")
示例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.")
示例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))