本文整理汇总了Python中test_support.findfile函数的典型用法代码示例。如果您正苦于以下问题:Python findfile函数的具体用法?Python findfile怎么用?Python findfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了findfile函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_expat_locator_withinfo
def test_expat_locator_withinfo():
result = StringIO()
xmlgen = XMLGenerator(result)
parser = create_parser()
parser.setContentHandler(xmlgen)
parser.parse(findfile("test.xml"))
return parser.getSystemId() == findfile("test.xml") and parser.getPublicId() is None
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:8,代码来源:test_sax.py
示例2: make_test_output
def make_test_output():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
parser.parse(findfile("test" + os.extsep + "xml"))
outf = open(findfile("test" + os.extsep + "xml" + os.extsep + "out"), "w")
outf.write(result.getvalue())
outf.close()
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:11,代码来源:test_sax.py
示例3: main
def main():
uu.decode(findfile('testrgb.uue'), 'test.rgb')
uu.decode(findfile('greyrgb.uue'), 'greytest.rgb')
# Test a 3 byte color image
testimage('test.rgb')
# Test a 1 byte greyscale image
testimage('greytest.rgb')
unlink('test.rgb')
unlink('greytest.rgb')
开发者ID:Bail-jw,项目名称:mediacomp-jes,代码行数:13,代码来源:test_imgfile.py
示例4: testimg
def testimg(rgb_file, raw_file):
rgb_file = findfile(rgb_file)
raw_file = findfile(raw_file)
width, height = rgbimg.sizeofimage(rgb_file)
rgb = rgbimg.longimagedata(rgb_file)
if len(rgb) != width * height * 4:
raise error, 'bad image length'
raw = open(raw_file, 'rb').read()
if rgb != raw:
raise error, \
'images don\'t match for '+rgb_file+' and '+raw_file
for depth in [1, 3, 4]:
rgbimg.longstoimage(rgb, width, height, depth, '@.rgb')
os.unlink('@.rgb')
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:14,代码来源:test_rgbimg.py
示例5: test_print_sans_lib
def test_print_sans_lib(self):
'''Encodes and decodes using utf-8 after in an environment without the standard library
Checks that the builtin utf-8 codec is always available: http://bugs.jython.org/issue1458'''
subprocess.call([sys.executable, "-J-Dpython.cachedir.skip=true",
"-J-Dpython.security.respectJavaAccessibility=false",
test_support.findfile('print_sans_lib.py')])
开发者ID:aniket134,项目名称:XBMC-video-plugins,代码行数:7,代码来源:test_codecs_jy.py
示例6: setUp
def setUp(self):
# In Python, audiotest.au lives in Lib/test not Lib/test/data
fp = open(findfile('audiotest.au'))
try:
self._audiodata = fp.read()
finally:
fp.close()
self._au = MIMEAudio(self._audiodata)
开发者ID:mancoast,项目名称:CPythonPyc_test,代码行数:8,代码来源:221_test_email.py
示例7: test_expat_inpsource_filename
def test_expat_inpsource_filename():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
parser.parse(findfile("test.xml"))
return result.getvalue() == xml_test_out
开发者ID:mancoast,项目名称:CPythonPyc_test,代码行数:9,代码来源:213_test_sax.py
示例8: test_expat_inpsource_sysid
def test_expat_inpsource_sysid():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
parser.parse(InputSource(findfile("test" + os.extsep + "xml")))
return result.getvalue() == xml_test_out
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:9,代码来源:test_sax.py
示例9: test_expat_inpsource_stream
def test_expat_inpsource_stream():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
inpsrc = InputSource()
inpsrc.setByteStream(open(findfile("test" + os.extsep + "xml")))
parser.parse(inpsrc)
return result.getvalue() == xml_test_out
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:11,代码来源:test_sax.py
示例10: open
from test_support import verbose, findfile
import tokenize, os, sys
if verbose:
print 'starting...'
file = open(findfile('tokenize_tests.py'))
tokenize.tokenize(file.readline)
if verbose:
print 'finished'
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:9,代码来源:test_tokenize.py
示例11: test
def test():
play_sound_file(findfile('audiotest.au'))
test_errors()
开发者ID:denis-vilyuzhanin,项目名称:OpenModelSphereMirror,代码行数:3,代码来源:test_linuxaudiodev.py
示例12: test
def test():
play_sound_file(findfile("audiotest.au"))
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:2,代码来源:test_sunaudiodev.py
示例13:
from test_support import verbose, findfile, TestFailed, TestSkipped
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:1,代码来源:test_linuxaudiodev.py
示例14: open
from test_support import verbose, findfile
import tokenize, os, sys
if verbose:
print 'starting...'
file = open(findfile('tokenize_tests'+os.extsep+'py'))
tokenize.tokenize(file.readline)
if verbose:
print 'finished'
开发者ID:Bail-jw,项目名称:mediacomp-jes,代码行数:9,代码来源:test_tokenize.py
示例15: len
return attrs.getLength() == 1 and \
attrs.getNames() == [(ns_uri, "attr")] and \
attrs.getQNames() == [] and \
len(attrs) == 1 and \
attrs.has_key((ns_uri, "attr")) and \
attrs.keys() == [(ns_uri, "attr")] and \
attrs.get((ns_uri, "attr")) == "val" and \
attrs.get((ns_uri, "attr"), 25) == "val" and \
attrs.items() == [((ns_uri, "attr"), "val")] and \
attrs.values() == ["val"] and \
attrs.getValue((ns_uri, "attr")) == "val" and \
attrs[(ns_uri, "attr")] == "val"
# ===== InputSource support
xml_test_out = open(findfile("test.xml.out")).read()
def test_expat_inpsource_filename():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
parser.parse(findfile("test.xml"))
return result.getvalue() == xml_test_out
def test_expat_inpsource_sysid():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
开发者ID:mancoast,项目名称:CPythonPyc_test,代码行数:31,代码来源:213_test_sax.py
示例16: open
raise error, 'bad image length'
raw = open(raw_file, 'rb').read()
if rgb != raw:
raise error, \
'images don\'t match for '+rgb_file+' and '+raw_file
for depth in [1, 3, 4]:
rgbimg.longstoimage(rgb, width, height, depth, '@.rgb')
os.unlink('@.rgb')
table = [
('testrgb.uue', 'test.rgb'),
('testimg.uue', 'test.rawimg'),
('testimgr.uue', 'test.rawimg.rev'),
]
for source, target in table:
source = findfile(source)
target = findfile(target)
if verbose:
print "uudecoding", source, "->", target, "..."
uu.decode(source, target)
if verbose:
print "testing..."
ttob = rgbimg.ttob(0)
if ttob != 0:
raise error, 'ttob should start out as zero'
testimg('test.rgb', 'test.rawimg')
ttob = rgbimg.ttob(1)
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:31,代码来源:test_rgbimg.py
示例17: len
and attrs.getQNames() == []
and len(attrs) == 1
and attrs.has_key((ns_uri, "attr"))
and attrs.keys() == [(ns_uri, "attr")]
and attrs.get((ns_uri, "attr")) == "val"
and attrs.get((ns_uri, "attr"), 25) == "val"
and attrs.items() == [((ns_uri, "attr"), "val")]
and attrs.values() == ["val"]
and attrs.getValue((ns_uri, "attr")) == "val"
and attrs[(ns_uri, "attr")] == "val"
)
# ===== InputSource support
xml_test_out = open(findfile("test" + os.extsep + "xml" + os.extsep + "out")).read()
def test_expat_inpsource_filename():
parser = create_parser()
result = StringIO()
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
parser.parse(findfile("test" + os.extsep + "xml"))
return result.getvalue() == xml_test_out
def test_expat_inpsource_sysid():
parser = create_parser()
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:31,代码来源:test_sax.py
示例18:
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:1,代码来源:test_imgfile.py
示例19: Copyright
# Copyright (C) 2001 Python Software Foundation
开发者ID:mcyril,项目名称:ravel-ftn,代码行数:1,代码来源:test_email.py
注:本文中的test_support.findfile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论