[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31076] trunk/lib/tests/python: 1.

Leif Andersen leif.a.andersen at gmail.com
Thu Aug 5 19:28:57 CEST 2010


Revision: 31076
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31076
Author:   leifandersen
Date:     2010-08-05 19:28:57 +0200 (Thu, 05 Aug 2010)

Log Message:
-----------
1.  Added the python scripts I forgot to add last time.

2.  Started upgrading the blends to 2.5x as well.

Modified Paths:
--------------
    trunk/lib/tests/python/Armature_example2.py.blend

Added Paths:
-----------
    trunk/lib/tests/python/Armature_example2.py
    trunk/lib/tests/python/BGL_example.py
    trunk/lib/tests/python/Camera_example.py
    trunk/lib/tests/python/Constraint_example1.py
    trunk/lib/tests/python/Constraint_example2.py
    trunk/lib/tests/python/Draw_example.py
    trunk/lib/tests/python/Font_example.py
    trunk/lib/tests/python/Group_example2.py
    trunk/lib/tests/python/MeshPrimitives_example.py
    trunk/lib/tests/python/Mesh_example.py
    trunk/lib/tests/python/MetaBall_example.py
    trunk/lib/tests/python/Modifier_example.py
    trunk/lib/tests/python/NMesh_example.py
    trunk/lib/tests/python/Object_example.py
    trunk/lib/tests/python/Radio_example.py
    trunk/lib/tests/python/Render_example.py
    trunk/lib/tests/python/Scene_example.py
    trunk/lib/tests/python/Sound_example.py
    trunk/lib/tests/python/Text3d_example.py
    trunk/lib/tests/python/Text_example.py
    trunk/lib/tests/python/Timeline.py
    trunk/lib/tests/python/Types_example.py
    trunk/lib/tests/python/Window_example1.py
    trunk/lib/tests/python/World_example1.py
    trunk/lib/tests/python/World_example2.py
    trunk/lib/tests/python/effect_example.py
    trunk/lib/tests/python/image_example.py
    trunk/lib/tests/python/lamp_modes_example.py
    trunk/lib/tests/python/script.py

Added: trunk/lib/tests/python/Armature_example2.py
===================================================================
--- trunk/lib/tests/python/Armature_example2.py	                        (rev 0)
+++ trunk/lib/tests/python/Armature_example2.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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

Modified: trunk/lib/tests/python/Armature_example2.py.blend
===================================================================
(Binary files differ)

Added: trunk/lib/tests/python/BGL_example.py
===================================================================
--- trunk/lib/tests/python/BGL_example.py	                        (rev 0)
+++ trunk/lib/tests/python/BGL_example.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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: trunk/lib/tests/python/Camera_example.py
===================================================================
--- trunk/lib/tests/python/Camera_example.py	                        (rev 0)
+++ trunk/lib/tests/python/Camera_example.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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: trunk/lib/tests/python/Constraint_example1.py
===================================================================
--- trunk/lib/tests/python/Constraint_example1.py	                        (rev 0)
+++ trunk/lib/tests/python/Constraint_example1.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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: trunk/lib/tests/python/Constraint_example2.py
===================================================================
--- trunk/lib/tests/python/Constraint_example2.py	                        (rev 0)
+++ trunk/lib/tests/python/Constraint_example2.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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: trunk/lib/tests/python/Draw_example.py
===================================================================
--- trunk/lib/tests/python/Draw_example.py	                        (rev 0)
+++ trunk/lib/tests/python/Draw_example.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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: trunk/lib/tests/python/Font_example.py
===================================================================
--- trunk/lib/tests/python/Font_example.py	                        (rev 0)
+++ trunk/lib/tests/python/Font_example.py	2010-08-05 17:28:57 UTC (rev 31076)
@@ -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([

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list