[Bf-blender-cvs] [f3566235ca1] blender2.8: Layers: Fix collection_rename unittest

Dalai Felinto noreply at git.blender.org
Tue Jan 2 20:44:00 CET 2018


Commit: f3566235ca1e8886328f213013452e12fe4be836
Author: Dalai Felinto
Date:   Tue Jan 2 16:59:25 2018 -0200
Branches: blender2.8
https://developer.blender.org/rBf3566235ca1e8886328f213013452e12fe4be836

Layers: Fix collection_rename unittest

This was broken since c9cb5dc3dab0af when we supported same name for
non-sibling collections.

===================================================================

M	tests/python/view_layer/test_collection_rename.py

===================================================================

diff --git a/tests/python/view_layer/test_collection_rename.py b/tests/python/view_layer/test_collection_rename.py
index 3fcc5981e68..ea156d7346f 100644
--- a/tests/python/view_layer/test_collection_rename.py
+++ b/tests/python/view_layer/test_collection_rename.py
@@ -34,7 +34,8 @@ class UnitTesting(ViewLayerTesting):
         family = self.setup_family()
 
         family['mom'].name = family['daughter'].name
-        self.assertNotEqual(family['mom'].name, family['daughter'].name)
+        # Since they are not siblings, we allow them to have the same name.
+        self.assertEqual(family['mom'].name, family['daughter'].name)
 
     def test_rename_b(self):
         family = self.setup_family()
@@ -46,7 +47,8 @@ class UnitTesting(ViewLayerTesting):
         family = self.setup_family()
 
         family['cousin'].name = family['daughter'].name
-        self.assertNotEqual(family['cousin'].name, family['daughter'].name)
+        # Since they are not siblings, we allow them to have the same name.
+        self.assertEqual(family['cousin'].name, family['daughter'].name)
 
     def test_rename_d(self):
         family = self.setup_family()
@@ -54,6 +56,12 @@ class UnitTesting(ViewLayerTesting):
         family['son'].name = family['daughter'].name
         self.assertNotEqual(family['son'].name, family['daughter'].name)
 
+    def test_rename_e(self):
+        family = self.setup_family()
+
+        family['grandma'].name = family['grandpa'].name
+        self.assertNotEqual(family['grandma'].name, family['grandpa'].name)
+
     def test_add_equal_name_a(self):
         family = self.setup_family()
 
@@ -64,7 +72,14 @@ class UnitTesting(ViewLayerTesting):
         family = self.setup_family()
 
         other_aunt = family['grandma'].collections.new(family['daughter'].name)
-        self.assertNotEqual(other_aunt.name, family['daughter'].name)
+        # Since they are not siblings, we allow them to have the same name.
+        self.assertEqual(other_aunt.name, family['daughter'].name)
+
+    def test_add_equal_name_c(self):
+        family = self.setup_family()
+
+        other_aunt = family['grandma'].collections.new(family['mom'].name)
+        self.assertNotEqual(other_aunt.name, family['mom'].name)
 
 
 # ############################################################



More information about the Bf-blender-cvs mailing list