Revision: 31081 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31081 Author: leifandersen Date: 2010-08-05 21:36:44 +0200 (Thu, 05 Aug 2010)
Log Message: ----------- 1. Added the python tests after finding out that they were being sent to a different svn repo (did I mention that I hate svn recently? :) ). (For those playing along at home, I also updated them from my last commit message, even though they apperently weren't in the tracker.) 2. Made the (hopefully last) modifications to the hashtest, taking into account many more particle settings. Modified Paths: -------------- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py Added Paths: ----------- branches/soc-2010-leifandersen/tests/python/ branches/soc-2010-leifandersen/tests/python/.bfont.ttf branches/soc-2010-leifandersen/tests/python/Armature_example2.py branches/soc-2010-leifandersen/tests/python/Armature_example2.py.blend branches/soc-2010-leifandersen/tests/python/BGL_example.py branches/soc-2010-leifandersen/tests/python/BGL_example.py.blend branches/soc-2010-leifandersen/tests/python/Camera_example.py branches/soc-2010-leifandersen/tests/python/Camera_example.py.blend branches/soc-2010-leifandersen/tests/python/Constraint_example1.py branches/soc-2010-leifandersen/tests/python/Constraint_example1.py.blend branches/soc-2010-leifandersen/tests/python/Constraint_example2.py branches/soc-2010-leifandersen/tests/python/Constraint_example2.py.blend branches/soc-2010-leifandersen/tests/python/Draw_example.py branches/soc-2010-leifandersen/tests/python/Draw_example.py.blend branches/soc-2010-leifandersen/tests/python/Font_example.py branches/soc-2010-leifandersen/tests/python/Font_example.py.blend branches/soc-2010-leifandersen/tests/python/Group_example2.py branches/soc-2010-leifandersen/tests/python/Group_example2.py.blend branches/soc-2010-leifandersen/tests/python/MeshPrimitives_example.py branches/soc-2010-leifandersen/tests/python/MeshPrimitives_example.py.blend branches/soc-2010-leifandersen/tests/python/Mesh_example.py branches/soc-2010-leifandersen/tests/python/Mesh_example.py.blend branches/soc-2010-leifandersen/tests/python/MetaBall_example.py branches/soc-2010-leifandersen/tests/python/MetaBall_example.py.blend branches/soc-2010-leifandersen/tests/python/Modifier_example.py branches/soc-2010-leifandersen/tests/python/Modifier_example.py.blend branches/soc-2010-leifandersen/tests/python/NMesh_example.py branches/soc-2010-leifandersen/tests/python/NMesh_example.py.blend branches/soc-2010-leifandersen/tests/python/Object_example.py branches/soc-2010-leifandersen/tests/python/Object_example.py.blend branches/soc-2010-leifandersen/tests/python/Radio_example.py branches/soc-2010-leifandersen/tests/python/Radio_example.py.blend branches/soc-2010-leifandersen/tests/python/Render_example.py branches/soc-2010-leifandersen/tests/python/Render_example.py.blend branches/soc-2010-leifandersen/tests/python/Scene_example.py branches/soc-2010-leifandersen/tests/python/Scene_example.py.blend branches/soc-2010-leifandersen/tests/python/Sound_example.py branches/soc-2010-leifandersen/tests/python/Sound_example.py.blend branches/soc-2010-leifandersen/tests/python/Text3d_example.py branches/soc-2010-leifandersen/tests/python/Text3d_example.py.blend branches/soc-2010-leifandersen/tests/python/Text_example.py branches/soc-2010-leifandersen/tests/python/Text_example.py.blend branches/soc-2010-leifandersen/tests/python/Timeline.py branches/soc-2010-leifandersen/tests/python/Timeline.py.blend branches/soc-2010-leifandersen/tests/python/Types_example.py branches/soc-2010-leifandersen/tests/python/Types_example.py.blend branches/soc-2010-leifandersen/tests/python/Window_example1.py branches/soc-2010-leifandersen/tests/python/Window_example1.py.blend branches/soc-2010-leifandersen/tests/python/World_example1.py branches/soc-2010-leifandersen/tests/python/World_example1.py.blend branches/soc-2010-leifandersen/tests/python/World_example2.py branches/soc-2010-leifandersen/tests/python/World_example2.py.blend branches/soc-2010-leifandersen/tests/python/effect_example.py branches/soc-2010-leifandersen/tests/python/effect_example.py.blend branches/soc-2010-leifandersen/tests/python/hashfile.txt branches/soc-2010-leifandersen/tests/python/image_example.py branches/soc-2010-leifandersen/tests/python/image_example.py.blend branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py.blend branches/soc-2010-leifandersen/tests/python/mandel-py.blend branches/soc-2010-leifandersen/tests/python/script.py branches/soc-2010-leifandersen/tests/python/test.png branches/soc-2010-leifandersen/tests/python/whistle.wav Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-05 19:20:00 UTC (rev 31080) +++ branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-05 19:36:44 UTC (rev 31081) @@ -137,6 +137,79 @@ for hair in particle.hair: for num in hair.location: hashcode += hash(num) + set = ps.settings + hashcode += hash(set.amount) + hashcode += hash(set.abs_path_time) + hashcode += hash(set.angular_velocity_factor) + hashcode += hash(set.angular_velocity_mode) + hashcode += hash(set.billboard_align) + hashcode += hash(set.billboard_animation) + hashcode += hash(set.billboard_lock) + for num in set.billboard_offset: + hashcode += hash(num) + hashcode += hash(set.billboard_tilt) + hashcode += hash(set.billboard_uv_split) + hashcode += hash(set.clumppow) + hashcode += hash(set.clump_factor) + hashcode += hash(set.child_size) + hashcode += hash(set.damp_factor) + hashcode += hash(set.draw_size) + hashcode += hash(set.draw_health) + hashcode += hash(set.effect_hair) + hashcode += hash(set.grid_resolution) + hashcode += hash(set.hair_bspline) + hashcode += hash(set.hair_step) + hashcode += hash(set.integrator) + hashcode += hash(set.jitter_factor) + hashcode += hash(set.keyed_loops) + hashcode += hash(set.keys_step) + hashcode += hash(set.lifetime) + hashcode += hash(set.line_length_head) + hashcode += hash(set.line_length_tail) + hashcode += hash(set.mass) + hashcode += hash(set.material) + hashcode += hash(set.material_color) + hashcode += hash(set.name) + hashcode += hash(set.num) + hashcode += hash(set.normal_factor) + hashcode += hash(set.particle_factor) + hashcode += hash(set.rand_group) + hashcode += hash(set.random_factor) + hashcode += hash(set.random_length) + hashcode += hash(set.rough1) + hashcode += hash(set.rough2) + hashcode += hash(set.rough1_size) + hashcode += hash(set.rough2_size) + hashcode += hash(set.rotate_from) + hashcode += hash(set.rotation_mode) + hashcode += hash(set.rotation_dynamic) + hashcode += hash(set.render_step) + hashcode += hash(set.render_strand) + hashcode += hash(set.rendered_child_nbr) + hashcode += hash(set.self_effect) + hashcode += hash(set.show_size) + hashcode += hash(set.simplify_rate) + hashcode += hash(set.simplify_refsize) + hashcode += hash(set.simplify_transition) + hashcode += hash(set.simplify_viewport) + hashcode += hash(set.sizemass) + hashcode += hash(set.size_deflect) + hashcode += hash(set.subframes) + hashcode += hash(set.tag) + hashcode += hash(set.tangent_factor) + hashcode += hash(set.tangent_phase) + hashcode += hash(set.trail_count) + hashcode += hash(set.trand) + hashcode += hash(set.type) + hashcode += hash(set.unborn) + hashcode += hash(set.users) + hashcode += hash(set.use_global_dupli) + hashcode += hash(set.use_group_count) + hashcode += hash(set.userjit) + hashcode += hash(set.velocity) + hashcode += hash(set.velocity_length) + hashcode += hash(set.viewport) + hashcode += hash(set.whole_group) if ob.type == 'LAMP': hashcode += hash(ob.data.rna_type.name) hashcode += hash(ob.data.name) Added: branches/soc-2010-leifandersen/tests/python/.bfont.ttf =================================================================== (Binary files differ) Property changes on: branches/soc-2010-leifandersen/tests/python/.bfont.ttf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/soc-2010-leifandersen/tests/python/Armature_example2.py =================================================================== --- branches/soc-2010-leifandersen/tests/python/Armature_example2.py (rev 0) +++ branches/soc-2010-leifandersen/tests/python/Armature_example2.py 2010-08-05 19:36:44 UTC (rev 31081) @@ -0,0 +1,67 @@ +import bpy +import tests +import mathutils + +import unittest +import sys +import os + +from mathutils import * + +data = [] + +class TestCurrentFile(unittest.TestCase): + + hash_start = 0 + hash_end = 0 + + def setUp(self): + for hashpair in data: + if hashpair[0] == os.path.split(bpy.data.filepath)[1] + '_start': + self.hash_start = hashpair[1] + if hashpair[0] == os.path.split(bpy.data.filepath)[1] + '_end': + self.hash_end = hashpair[1] + + def test_all_quads(self): + bpy.ops.tests.hash() + self.assertEquals(self.hash_start, tests.hashfile.last_hash) + + # Python tasks + arm = bpy.data.armatures['Armature'] + arm.drawtype = 'STICK' + bpy.ops.object.editmode_toggle() #Enter editmode + + #Generating new editbone + eb = arm.edit_bones.new('myNewBone') + eb.roll = 13 + eb.parent = arm.edit_bones['Bone.003'] + eb.head = Vector((1,1,1)) + eb.tail = Vector((0,0,1)) + eb.hinge = True + eb.connected = True + + #add the bone is done automatically + #delete an old bone + arm.edit_bones['Bone.002'].select = True + bpy.ops.armature.delete() + + bpy.ops.object.editmode_toggle() #Save changes + + for bone in arm.bones.values(): + print(bone.parent, bone.name) + print(bone.children, bone.name) + print(bone.hinge, bone.connected, bone.name) + + bpy.ops.tests.hash() + self.assertEquals(self.hash_end, tests.hashfile.last_hash) + +def suite(): + return unittest.TestSuite([ +unittest.TestLoader().loadTestsFromTestCase(TestCurrentFile), +]) + +if __name__ == "__main__": + print(bpy.ops.tests.read_hashfile(filepath="hashfile.txt")) + data = tests.hashfile.data + unittest.TextTestRunner(verbosity=2).run(suite()) + bpy.ops.wm.exit_blender() \ No newline at end of file Added: branches/soc-2010-leifandersen/tests/python/Armature_example2.py.blend =================================================================== (Binary files differ) Property changes on: branches/soc-2010-leifandersen/tests/python/Armature_example2.py.blend ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/soc-2010-leifandersen/tests/python/BGL_example.py =================================================================== --- branches/soc-2010-leifandersen/tests/python/BGL_example.py (rev 0) +++ branches/soc-2010-leifandersen/tests/python/BGL_example.py 2010-08-05 19:36:44 UTC (rev 31081) @@ -0,0 +1,40 @@ +import bpy +import tests + +import unittest +import sys +import os + +data = [] + +class TestCurrentFile(unittest.TestCase): + + hash_start = 0 + hash_end = 0 + + def setUp(self): + for hashpair in data: + if hashpair[0] == os.path.split(bpy.data.filepath)[1] + '_start': + self.hash_start = hashpair[1] + if hashpair[0] == os.path.split(bpy.data.filepath)[1] + '_end': + self.hash_end = hashpair[1] + + def test_all_quads(self): + bpy.ops.tests.hash() + self.assertEquals(self.hash_start, tests.hashfile.last_hash) + + # Insert Here + + bpy.ops.tests.hash() + self.assertEquals(self.hash_end, tests.hashfile.last_hash) + +def suite(): + return unittest.TestSuite([ +unittest.TestLoader().loadTestsFromTestCase(TestCurrentFile), +]) + +if __name__ == "__main__": + print(bpy.ops.tests.read_hashfile(filepath="hashfile.txt")) + data = tests.hashfile.data + unittest.TextTestRunner(verbosity=2).run(suite()) + bpy.ops.wm.exit_blender() \ No newline at end of file Added: branches/soc-2010-leifandersen/tests/python/BGL_example.py.blend =================================================================== (Binary files differ) Property changes on: branches/soc-2010-leifandersen/tests/python/BGL_example.py.blend ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/soc-2010-leifandersen/tests/python/Camera_example.py =================================================================== --- branches/soc-2010-leifandersen/tests/python/Camera_example.py (rev 0) +++ branches/soc-2010-leifandersen/tests/python/Camera_example.py 2010-08-05 19:36:44 UTC (rev 31081) @@ -0,0 +1,45 @@ +import bpy +import tests + +import unittest +import sys +import os + +data = [] + +class TestCurrentFile(unittest.TestCase): + + hash_start = 0 + hash_end = 0 + + def setUp(self): @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs