本文整理汇总了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))