本文整理汇总了Python中test_utils.get_input_path函数的典型用法代码示例。如果您正苦于以下问题:Python get_input_path函数的具体用法?Python get_input_path怎么用?Python get_input_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_input_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_linux_ci_failure_bug570
def test_linux_ci_failure_bug570():
table_path = get_input_path('1_fdict.cff')
font_path = get_input_path('core.otf')
actual_path = get_temp_file_path()
runner(CMD + ['-a', '-o', 'a', '_CFF={}'.format(table_path),
'-f', font_path, actual_path])
expected_path = get_expected_path('1_fdict.otf')
assert differ([expected_path, actual_path, '-m', 'bin'])
示例2: test_feature_includes_type1_bug164
def test_feature_includes_type1_bug164(feat_filename):
input_filename = "bug164/d1/d2/font.pfa"
otf_path = get_temp_file_path()
runner(CMD + ['-o',
'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(otf_path)])
assert font_has_table(otf_path, 'head')
示例3: test_contextual_multiple_substitutions_bug725
def test_contextual_multiple_substitutions_bug725():
input_filename = "bug725/font.pfa"
feat_filename = "bug725/feat.fea"
actual_path = get_temp_file_path()
ttx_filename = "bug725.ttx"
runner(CMD + ['-o', 'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(actual_path)])
actual_ttx = generate_ttx_dump(actual_path, ['GSUB'])
expected_ttx = get_expected_path(ttx_filename)
assert differ([expected_ttx, actual_ttx, '-s', '<ttFont sfntVersion'])
示例4: test_GDEF_LigatureCaret_bug155
def test_GDEF_LigatureCaret_bug155(caret_format):
input_filename = 'bug155/font.pfa'
feat_filename = 'bug155/caret-{}.fea'.format(caret_format)
ttx_filename = 'bug155/caret-{}.ttx'.format(caret_format)
actual_path = get_temp_file_path()
runner(CMD + ['-o', 'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(actual_path)])
actual_ttx = generate_ttx_dump(actual_path, ['GDEF'])
expected_ttx = get_expected_path(ttx_filename)
assert differ([expected_ttx, actual_ttx, '-l', '2'])
示例5: test_delete_zero_kb_font_on_fail_bug736
def test_delete_zero_kb_font_on_fail_bug736():
input_filename = 'bug736/font.pfa'
feat_filename = 'bug736/feat.fea'
out_filename = 'bug736/SourceSans-Test.otf'
with pytest.raises(subprocess.CalledProcessError) as err:
runner(CMD + ['-o',
'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename))])
assert err.value.returncode == 1
assert os.path.exists(get_input_path(out_filename)) is False
示例6: test_useMarkFilteringSet_flag_bug196
def test_useMarkFilteringSet_flag_bug196():
input_filename = "bug196/font.pfa"
feat_filename = "bug196/feat.fea"
actual_path = get_temp_file_path()
ttx_filename = "bug196.ttx"
runner(CMD + ['-o', 'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(actual_path)])
actual_ttx = generate_ttx_dump(actual_path, ['GSUB'])
expected_ttx = get_expected_path(ttx_filename)
assert differ([expected_ttx, actual_ttx, '-s', '<ttFont sfntVersion'])
示例7: test_useException_bug321
def test_useException_bug321():
input_filename = "bug321/font.pfa"
feat_filename = "bug321/feat.fea"
actual_path = get_temp_file_path()
ttx_filename = "bug321.ttx"
runner(CMD + ['-o', 'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(actual_path)])
actual_ttx = generate_ttx_dump(actual_path, ['GSUB', 'GPOS'])
expected_ttx = get_expected_path(ttx_filename)
assert differ([expected_ttx, actual_ttx, '-s', '<ttFont sfntVersion'])
示例8: test_mark_refer_diff_classes_bug416
def test_mark_refer_diff_classes_bug416():
input_filename = "bug416/font.pfa"
feat_filename = "bug416/feat.fea"
actual_path = get_temp_file_path()
ttx_filename = "bug416.ttx"
runner(CMD + ['-o', 'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(actual_path)])
actual_ttx = generate_ttx_dump(actual_path, ['GPOS'])
expected_ttx = get_expected_path(ttx_filename)
assert differ([expected_ttx, actual_ttx, '-s', '<ttFont sfntVersion'])
示例9: test_add_table
def test_add_table():
table_path = get_input_path('GDEF_italic.tb')
font_path = get_input_path(ITALIC)
actual_path = get_temp_file_path()
assert font_has_table(font_path, 'GDEF') is False
runner(CMD + ['-a', '-o', 'a', '_GDEF={}'.format(table_path),
'-f', font_path, actual_path])
expected_path = get_expected_path('italic_w_GDEF.otf')
assert differ([expected_path, actual_path, '-m', 'bin']) is False
assert font_has_table(actual_path, 'GDEF')
actual_ttx = generate_ttx_dump(actual_path)
expected_ttx = generate_ttx_dump(expected_path)
assert differ([expected_ttx, actual_ttx, '-s', ' <checkSumAdjustment'])
示例10: test_warnings_bug635
def test_warnings_bug635():
font1_path = get_input_path('bug635/cidfont.ps')
font2_path = get_input_path('bug635/rotated.ps')
actual_path = get_temp_file_path()
expected_path = get_expected_path('bug635.txt')
warnings_path = runner(
CMD + ['-s', '-e', '-a', '-f', actual_path, font1_path, font2_path])
# On Windows the messages start with 'mergefonts.exe:'
with open(warnings_path, 'rb') as f:
warnings = f.read().replace(b'mergefonts.exe:', b'mergefonts:')
with open(warnings_path, 'wb') as f:
f.write(warnings)
assert differ([expected_path, warnings_path, '-l', '1,5-7,11-12'])
示例11: test_parameter_offset_overflow_bug746
def test_parameter_offset_overflow_bug746():
input_filename = 'bug746/font.pfa'
feat_filename = 'bug746/feat.fea'
otf_path = get_temp_file_path()
stderr_path = runner(
CMD + ['-s', '-e', '-o', 'shw',
'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(otf_path)])
with open(stderr_path, 'rb') as f:
output = f.read()
assert(b"[FATAL] <bug746> feature parameter offset too large") in output
示例12: test_ttf_input_font_bug680
def test_ttf_input_font_bug680():
input_filename = 'bug680/font.ttf'
feat_filename = 'bug680/features.fea'
ttf_path = get_temp_file_path()
runner(CMD + ['-o', 'r',
'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(ttf_path)])
for table_tag in ('head', 'hhea', 'maxp', 'OS/2', 'hmtx', 'cmap', 'fpgm',
'prep', 'cvt ', 'loca', 'glyf', 'name', 'post', 'gasp',
'BASE', 'GDEF', 'GPOS', 'GSUB'):
assert font_has_table(ttf_path, table_tag)
示例13: test_overflow_report_bug313
def test_overflow_report_bug313(feat_name, error_msg):
input_filename = 'bug313/font.pfa'
feat_filename = 'bug313/{}.fea'.format(feat_name)
otf_path = get_temp_file_path()
stderr_path = runner(
CMD + ['-s', '-e', '-o', 'shw',
'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(otf_path)])
with open(stderr_path, 'rb') as f:
output = f.read()
assert error_msg in output
示例14: test_input_formats
def test_input_formats(arg, input_filename, ttx_filename):
if 'gf' in arg:
arg.append('_{}'.format(get_input_path('GOADB.txt')))
actual_path = get_temp_file_path()
runner(CMD + ['-o', 'f', '_{}'.format(get_input_path(input_filename)),
'o', '_{}'.format(actual_path)] + arg)
actual_ttx = generate_ttx_dump(actual_path)
expected_ttx = get_expected_path(ttx_filename)
assert differ([expected_ttx, actual_ttx,
'-s',
'<ttFont sfntVersion' + SPLIT_MARKER +
' <checkSumAdjustment value=' + SPLIT_MARKER +
' <created value=' + SPLIT_MARKER +
' <modified value=',
'-r', r'^\s+Version.*;hotconv.*;makeotfexe'])
示例15: test_feature_recursion_bug628
def test_feature_recursion_bug628():
input_filename = 'bug628/font.pfa'
feat_filename = 'bug628/feat.fea'
otf_path = get_temp_file_path()
stderr_path = runner(
CMD + ['-s', '-e', '-o', 'shw',
'f', '_{}'.format(get_input_path(input_filename)),
'ff', '_{}'.format(get_input_path(feat_filename)),
'o', '_{}'.format(otf_path)])
with open(stderr_path, 'rb') as f:
output = f.read()
assert(b"[FATAL] <SourceSans-Test> Can't include [feat.fea]; maximum "
b"include levels <50> reached") in output