本文整理匯總了Python中test.test_support._4G屬性的典型用法代碼示例。如果您正苦於以下問題:Python test_support._4G屬性的具體用法?Python test_support._4G怎麽用?Python test_support._4G使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類test.test_support
的用法示例。
在下文中一共展示了test_support._4G屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testBigmem
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def testBigmem(self, size):
# Issue #14398: decompression fails when output data is >=2GB.
if size < _4G:
self.skipTest("Test needs 5GB of memory to run.")
compressed = bz2.compress("a" * _4G)
text = bz2.BZ2Decompressor().decompress(compressed)
self.assertEqual(len(text), _4G)
self.assertEqual(text.strip("a"), "")
示例2: testDecompressBigmem
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def testDecompressBigmem(self, size):
# Issue #14398: decompression fails when output data is >=2GB.
if size < _4G:
self.skipTest("Test needs 5GB of memory to run.")
compressed = bz2.compress("a" * _4G)
text = bz2.decompress(compressed)
self.assertEqual(len(text), _4G)
self.assertEqual(text.strip("a"), "")
示例3: test_case_sha1_huge
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def test_case_sha1_huge(self, size):
if size == _4G + 5:
try:
self.check('sha1', 'A'*size,
'87d745c50e6b2879ffa0fb2c930e9fbfe0dc9a5b')
except OverflowError:
pass # 32-bit arch
示例4: test_case_sha1_huge_update
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def test_case_sha1_huge_update(self, size):
if size == _4G + 5:
try:
self.check_update('sha1', 'A'*size,
'87d745c50e6b2879ffa0fb2c930e9fbfe0dc9a5b')
except OverflowError:
pass # 32-bit arch
# use the examples from Federal Information Processing Standards
# Publication 180-2, Secure Hash Standard, 2002 August 1
# http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
示例5: test_case_md5_huge
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def test_case_md5_huge(self, size):
if size == _4G + 5:
try:
self.check('md5', 'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d')
except OverflowError:
pass # 32-bit arch
示例6: test_case_md5_huge_update
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def test_case_md5_huge_update(self, size):
if size == _4G + 5:
try:
self.check_update('md5', 'A'*size,
'c9af2dff37468ce5dfee8f2cfc0a9c6d')
except OverflowError:
pass # 32-bit arch
示例7: test_case_md5_uintmax
# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import _4G [as 別名]
def test_case_md5_uintmax(self, size):
if size == _4G - 1:
try:
self.check('md5', 'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3')
except OverflowError:
pass # 32-bit arch
# use the three examples from Federal Information Processing Standards
# Publication 180-1, Secure Hash Standard, 1995 April 17
# http://www.itl.nist.gov/div897/pubs/fip180-1.htm