diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-09-25 22:19:04 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-09-25 22:19:04 (GMT) |
commit | 53d289074458b53d634a9aa922250a5c08b6c2d9 (patch) | |
tree | e11c3ea791864caa646af308d82d101214e82b18 /test/toolpath | |
parent | 2e0de3c55f22b3eaa7767b69740b898f3d2f46bf (diff) | |
download | SCons-53d289074458b53d634a9aa922250a5c08b6c2d9.zip SCons-53d289074458b53d634a9aa922250a5c08b6c2d9.tar.gz SCons-53d289074458b53d634a9aa922250a5c08b6c2d9.tar.bz2 |
Fix tests which break when using print() and no from __future__ import print_function under python 2.7 because the print('a','b') effectively becomes printing a tuple which doesn't match the expected strings
Diffstat (limited to 'test/toolpath')
-rw-r--r-- | test/toolpath/basic.py | 60 | ||||
-rw-r--r-- | test/toolpath/nested/image/SConstruct | 42 | ||||
-rw-r--r-- | test/toolpath/relative_import/image/SConstruct | 10 |
3 files changed, 56 insertions, 56 deletions
diff --git a/test/toolpath/basic.py b/test/toolpath/basic.py index 86dafca..793497b 100644 --- a/test/toolpath/basic.py +++ b/test/toolpath/basic.py @@ -35,65 +35,65 @@ def foo(env): env['TOOL_FOO'] = 1 env1 = Environment(tools=[foo, 'bar'], toolpath=['tools']) -print("env1['TOOL_FOO'] =", env1.get('TOOL_FOO')) -print("env1['TOOL_BAR'] =", env1.get('TOOL_BAR')) +print("env1['TOOL_FOO'] = %s"%env1.get('TOOL_FOO')) +print("env1['TOOL_BAR'] = %s"%env1.get('TOOL_BAR')) # pick a built-in tool with pretty simple behavior env2 = Environment(tools=['zip']) -print("env2['ZIP'] =", env2.get('ZIP')) -print("env2['TOOL_zip1'] =", env2.get('TOOL_zip1')) -print("env2['TOOLDIR_zip'] =", env2.get('TOOLDIR_zip')) +print("env2['ZIP'] = %s"%env2.get('ZIP')) +print("env2['TOOL_zip1'] = %s"%env2.get('TOOL_zip1')) +print("env2['TOOLDIR_zip'] = %s"%env2.get('TOOLDIR_zip')) # Only find tools in current dir, or Scons.Tool.TOOLNAME env3 = Environment(tools=['zip'], toolpath=['.']) -print("env3['ZIP'] =", env3.get('ZIP')) -print("env3['TOOL_zip1'] =", env3.get('TOOL_zip1')) -print("env3['TOOLDIR_zip'] =", env3.get('TOOLDIR_zip')) +print("env3['ZIP'] = %s"%env3.get('ZIP')) +print("env3['TOOL_zip1'] = %s"%env3.get('TOOL_zip1')) +print("env3['TOOLDIR_zip'] = %s"%env3.get('TOOLDIR_zip')) env4 = Environment(tools=['zip'], toolpath=['tools']) -print("env4['ZIP'] =", env4.get('ZIP')) -print("env4['TOOL_zip1'] =", env4.get('TOOL_zip1')) -print("env4['TOOLDIR_zip'] =", env4.get('TOOLDIR_zip')) +print("env4['ZIP'] = %s"%env4.get('ZIP')) +print("env4['TOOL_zip1'] = %s"%env4.get('TOOL_zip1')) +print("env4['TOOLDIR_zip'] = %s"%env4.get('TOOLDIR_zip')) # Should pick up from tools dir, and then current dir env5 = Environment(tools=['zip'], toolpath=['tools', '.']) -print("env5['ZIP'] =", env5.get('ZIP')) -print("env5['TOOL_zip1'] =", env5.get('TOOL_zip1')) -print("env5['TOOLDIR_zip'] =", env5.get('TOOLDIR_zip')) +print("env5['ZIP'] = %s"%env5.get('ZIP')) +print("env5['TOOL_zip1'] = %s"%env5.get('TOOL_zip1')) +print("env5['TOOLDIR_zip'] = %s"%env5.get('TOOLDIR_zip')) # Should pick up from current dir, and then tools dir env6 = Environment(tools=['zip'], toolpath=['.', 'tools']) -print("env6['ZIP'] =", env6.get('ZIP')) -print("env6['TOOL_zip1'] =", env6.get('TOOL_zip1')) -print("env6['TOOLDIR_zip'] =", env6.get('TOOLDIR_zip')) +print("env6['ZIP'] = %s"%env6.get('ZIP')) +print("env6['TOOL_zip1'] = %s"%env6.get('TOOL_zip1')) +print("env6['TOOLDIR_zip'] = %s"%env6.get('TOOLDIR_zip')) env7 = Environment(TOOLPATH="tools", tools=['zip'], toolpath=['$TOOLPATH']) -print("env7['ZIP'] =", env7.get('ZIP')) -print("env7['TOOL_zip1'] =", env7.get('TOOL_zip1')) -print("env7['TOOLDIR_zip'] =", env7.get('TOOLDIR_zip')) +print("env7['ZIP'] = %s"%env7.get('ZIP')) +print("env7['TOOL_zip1'] = %s"%env7.get('TOOL_zip1')) +print("env7['TOOLDIR_zip'] = %s"%env7.get('TOOLDIR_zip')) env8 = Environment(tools=[]) env8.Tool('zip', toolpath=['tools']) -print("env8['ZIP'] =", env8.get('ZIP')) -print("env8['TOOL_zip1'] =", env8.get('TOOL_zip1')) -print("env8['TOOLDIR_zip'] =", env8.get('TOOLDIR_zip')) +print("env8['ZIP'] = %s"%env8.get('ZIP')) +print("env8['TOOL_zip1'] = %s"%env8.get('TOOL_zip1')) +print("env8['TOOLDIR_zip'] = %s"%env8.get('TOOLDIR_zip')) env9 = Environment(tools=[]) Tool('zip', toolpath=['tools'])(env9) -print("env9['ZIP'] =", env9.get('ZIP')) -print("env9['TOOL_zip1'] =", env9.get('TOOL_zip1')) -print("env9['TOOLDIR_zip'] =", env9.get('TOOLDIR_zip')) +print("env9['ZIP'] = %s"%env9.get('ZIP')) +print("env9['TOOL_zip1'] = %s"%env9.get('TOOL_zip1')) +print("env9['TOOLDIR_zip'] = %s"%env9.get('TOOLDIR_zip')) env0 = Environment(TOOLPATH='tools', tools=[]) env0.Tool('zip', toolpath=['$TOOLPATH']) -print("env0['ZIP'] =", env0.get('ZIP')) -print("env0['TOOL_zip1'] =", env0.get('TOOL_zip1')) -print("env0['TOOLDIR_zip'] =", env0.get('TOOLDIR_zip')) +print("env0['ZIP'] = %s"%env0.get('ZIP')) +print("env0['TOOL_zip1'] = %s"%env0.get('TOOL_zip1')) +print("env0['TOOLDIR_zip'] = %s"%env0.get('TOOLDIR_zip')) base = Environment(tools=[], toolpath=['tools']) derived = base.Clone(tools=['bar']) -print("derived['TOOL_BAR'] =", derived.get('TOOL_BAR')) +print("derived['TOOL_BAR'] = %s"%derived.get('TOOL_BAR')) """) test.write('zip.py', r""" diff --git a/test/toolpath/nested/image/SConstruct b/test/toolpath/nested/image/SConstruct index a7c6ceb..1187a7c 100644 --- a/test/toolpath/nested/image/SConstruct +++ b/test/toolpath/nested/image/SConstruct @@ -10,26 +10,26 @@ toollist = ['Toolpath_TestTool1', print('Test where tools are located under site_scons/site_tools')
env1 = Environment(tools=toollist)
-print("env1['Toolpath_TestTool1'] =", env1.get('Toolpath_TestTool1'))
-print("env1['Toolpath_TestTool2'] =", env1.get('Toolpath_TestTool2'))
-print("env1['Toolpath_TestTool1_1'] =", env1.get('Toolpath_TestTool1_1'))
-print("env1['Toolpath_TestTool1_2'] =", env1.get('Toolpath_TestTool1_2'))
-print("env1['Toolpath_TestTool2_1'] =", env1.get('Toolpath_TestTool2_1'))
-print("env1['Toolpath_TestTool2_2'] =", env1.get('Toolpath_TestTool2_2'))
+print("env1['Toolpath_TestTool1'] = %s"%env1.get('Toolpath_TestTool1'))
+print("env1['Toolpath_TestTool2'] = %s"%env1.get('Toolpath_TestTool2'))
+print("env1['Toolpath_TestTool1_1'] = %s"%env1.get('Toolpath_TestTool1_1'))
+print("env1['Toolpath_TestTool1_2'] = %s"%env1.get('Toolpath_TestTool1_2'))
+print("env1['Toolpath_TestTool2_1'] = %s"%env1.get('Toolpath_TestTool2_1'))
+print("env1['Toolpath_TestTool2_2'] = %s"%env1.get('Toolpath_TestTool2_2'))
print('Test where toolpath is set in the env constructor')
env2 = Environment(tools=toollist, toolpath=['Libs/tools_example'])
-print("env2['Toolpath_TestTool1'] =", env2.get('Toolpath_TestTool1'))
-print("env2['Toolpath_TestTool2'] =", env2.get('Toolpath_TestTool2'))
-print("env2['Toolpath_TestTool1_1'] =", env2.get('Toolpath_TestTool1_1'))
-print("env2['Toolpath_TestTool1_2'] =", env2.get('Toolpath_TestTool1_2'))
-print("env2['Toolpath_TestTool2_1'] =", env2.get('Toolpath_TestTool2_1'))
-print("env2['Toolpath_TestTool2_2'] =", env2.get('Toolpath_TestTool2_2'))
+print("env2['Toolpath_TestTool1'] = %s"%env2.get('Toolpath_TestTool1'))
+print("env2['Toolpath_TestTool2'] = %s"%env2.get('Toolpath_TestTool2'))
+print("env2['Toolpath_TestTool1_1'] = %s"%env2.get('Toolpath_TestTool1_1'))
+print("env2['Toolpath_TestTool1_2'] = %s"%env2.get('Toolpath_TestTool1_2'))
+print("env2['Toolpath_TestTool2_1'] = %s"%env2.get('Toolpath_TestTool2_1'))
+print("env2['Toolpath_TestTool2_2'] = %s"%env2.get('Toolpath_TestTool2_2'))
print('Test a Clone')
base = Environment(tools=[], toolpath=['Libs/tools_example'])
derived = base.Clone(tools=['subdir1.Toolpath_TestTool1_1'])
-print("derived['Toolpath_TestTool1_1'] =", derived.get('Toolpath_TestTool1_1'))
+print("derived['Toolpath_TestTool1_1'] = %s"%derived.get('Toolpath_TestTool1_1'))
print('Test using syspath as the toolpath')
@@ -52,18 +52,18 @@ toollist = ['tools_example.Toolpath_TestTool1', ]
env3 = Environment(tools=toollist, toolpath=searchpaths)
-print("env3['Toolpath_TestTool1'] =", env3.get('Toolpath_TestTool1'))
-print("env3['Toolpath_TestTool2'] =", env3.get('Toolpath_TestTool2'))
-print("env3['Toolpath_TestTool1_1'] =", env3.get('Toolpath_TestTool1_1'))
-print("env3['Toolpath_TestTool1_2'] =", env3.get('Toolpath_TestTool1_2'))
-print("env3['Toolpath_TestTool2_1'] =", env3.get('Toolpath_TestTool2_1'))
-print("env3['Toolpath_TestTool2_2'] =", env3.get('Toolpath_TestTool2_2'))
+print("env3['Toolpath_TestTool1'] = %s"%env3.get('Toolpath_TestTool1'))
+print("env3['Toolpath_TestTool2'] = %s"%env3.get('Toolpath_TestTool2'))
+print("env3['Toolpath_TestTool1_1'] = %s"%env3.get('Toolpath_TestTool1_1'))
+print("env3['Toolpath_TestTool1_2'] = %s"%env3.get('Toolpath_TestTool1_2'))
+print("env3['Toolpath_TestTool2_1'] = %s"%env3.get('Toolpath_TestTool2_1'))
+print("env3['Toolpath_TestTool2_2'] = %s"%env3.get('Toolpath_TestTool2_2'))
print('Test using PyPackageDir')
toollist = ['Toolpath_TestTool2_1', 'Toolpath_TestTool2_2']
env4 = Environment(tools = toollist, toolpath = [PyPackageDir('tools_example.subdir1.subdir2')])
-print("env4['Toolpath_TestTool2_1'] =", env4.get('Toolpath_TestTool2_1'))
-print("env4['Toolpath_TestTool2_2'] =", env4.get('Toolpath_TestTool2_2'))
+print("env4['Toolpath_TestTool2_1'] = %s"%env4.get('Toolpath_TestTool2_1'))
+print("env4['Toolpath_TestTool2_2'] = %s"%env4.get('Toolpath_TestTool2_2'))
sys.path = oldsyspath
diff --git a/test/toolpath/relative_import/image/SConstruct b/test/toolpath/relative_import/image/SConstruct index 6156929..c9b28bb 100644 --- a/test/toolpath/relative_import/image/SConstruct +++ b/test/toolpath/relative_import/image/SConstruct @@ -1,10 +1,10 @@ env = Environment(tools=['TestTool1', 'TestTool1.TestTool1_2'], toolpath=['tools'])
# Test a relative import within the root of the tools directory
-print("env['TestTool1'] =", env.get('TestTool1'))
-print("env['TestTool1_1'] =", env.get('TestTool1_1'))
+print("env['TestTool1'] = %s"%env.get('TestTool1'))
+print("env['TestTool1_1'] = %s"%env.get('TestTool1_1'))
# Test a relative import within a sub dir
-print("env['TestTool1_2'] =", env.get('TestTool1_2'))
-print("env['TestTool1_2_1'] =", env.get('TestTool1_2_1'))
-print("env['TestTool1_2_2'] =", env.get('TestTool1_2_2'))
+print("env['TestTool1_2'] = %s"%env.get('TestTool1_2'))
+print("env['TestTool1_2_1'] = %s"%env.get('TestTool1_2_1'))
+print("env['TestTool1_2_2'] = %s"%env.get('TestTool1_2_2'))
|