From f3566235ca1e8886328f213013452e12fe4be836 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 2 Jan 2018 16:59:25 -0200 Subject: Layers: Fix collection_rename unittest This was broken since c9cb5dc3dab0af when we supported same name for non-sibling collections. --- tests/python/view_layer/test_collection_rename.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'tests/python/view_layer') 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) # ############################################################ -- cgit v1.2.3