本文整理匯總了Python中mailbox._ProxyFile方法的典型用法代碼示例。如果您正苦於以下問題:Python mailbox._ProxyFile方法的具體用法?Python mailbox._ProxyFile怎麽用?Python mailbox._ProxyFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mailbox
的用法示例。
在下文中一共展示了mailbox._ProxyFile方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_initialize
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_initialize(self):
# Initialize and check position
self._file.write('foo')
pos = self._file.tell()
proxy0 = mailbox._ProxyFile(self._file)
self.assertEqual(proxy0.tell(), pos)
self.assertEqual(self._file.tell(), pos)
proxy1 = mailbox._ProxyFile(self._file, 0)
self.assertEqual(proxy1.tell(), 0)
self.assertEqual(self._file.tell(), pos)
示例2: test_read
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_read(self):
self._file.write('bar')
self._test_read(mailbox._ProxyFile(self._file))
示例3: test_readline
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_readline(self):
self._file.write('foo%sbar%sfred%sbob' % (os.linesep, os.linesep,
os.linesep))
self._test_readline(mailbox._ProxyFile(self._file))
示例4: test_readlines
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_readlines(self):
self._file.write('foo%sbar%sfred%sbob' % (os.linesep, os.linesep,
os.linesep))
self._test_readlines(mailbox._ProxyFile(self._file))
示例5: test_iteration
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_iteration(self):
self._file.write('foo%sbar%sfred%sbob' % (os.linesep, os.linesep,
os.linesep))
self._test_iteration(mailbox._ProxyFile(self._file))
示例6: test_close
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_close(self):
self._file.write('foo%sbar%s' % (os.linesep, os.linesep))
self._test_close(mailbox._ProxyFile(self._file))
示例7: test_initialize
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_initialize(self):
# Initialize and check position
self._file.write(b'foo')
pos = self._file.tell()
proxy0 = mailbox._ProxyFile(self._file)
self.assertEqual(proxy0.tell(), pos)
self.assertEqual(self._file.tell(), pos)
proxy1 = mailbox._ProxyFile(self._file, 0)
self.assertEqual(proxy1.tell(), 0)
self.assertEqual(self._file.tell(), pos)
示例8: test_read
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_read(self):
self._file.write(b'bar')
self._test_read(mailbox._ProxyFile(self._file))
示例9: test_readline
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_readline(self):
self._file.write(bytes('foo%sbar%sfred%sbob' % (os.linesep, os.linesep,
os.linesep), 'ascii'))
self._test_readline(mailbox._ProxyFile(self._file))
示例10: test_readlines
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_readlines(self):
self._file.write(bytes('foo%sbar%sfred%sbob' % (os.linesep, os.linesep,
os.linesep), 'ascii'))
self._test_readlines(mailbox._ProxyFile(self._file))
示例11: test_iteration
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_iteration(self):
self._file.write(bytes('foo%sbar%sfred%sbob' % (os.linesep, os.linesep,
os.linesep), 'ascii'))
self._test_iteration(mailbox._ProxyFile(self._file))
示例12: test_close
# 需要導入模塊: import mailbox [as 別名]
# 或者: from mailbox import _ProxyFile [as 別名]
def test_close(self):
self._file.write(bytes('foo%sbar%s' % (os.linesep, os.linesep), 'ascii'))
self._test_close(mailbox._ProxyFile(self._file))