From 6ab65ab47204ce7bd286067a0d5251102ca7ba44 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 20 Dec 2018 11:14:16 +0300 Subject: [PATCH] [Code coverage GeomAlgoAPI]: Check errors in MultiTranslation --- .../TestAPI_MultiTranslation.py | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/test.API/SHAPER/Transformations/TestAPI_MultiTranslation.py b/test.API/SHAPER/Transformations/TestAPI_MultiTranslation.py index 0a3ac7619..4b40b018c 100644 --- a/test.API/SHAPER/Transformations/TestAPI_MultiTranslation.py +++ b/test.API/SHAPER/Transformations/TestAPI_MultiTranslation.py @@ -58,18 +58,27 @@ MultiTranslation_5 = shaperpy.makeMultiTranslation(Box_5, ax1, 10., 5, ax2, 10., MultiTranslation_6 = shaperpy.makeMultiTranslation(Box_6, ax1, 15., 5, ax2, -10., 5) # Tests en erreur -#try: -# MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2) -#except myExcept,ec: -# assert(ec.what() == "Multitranslation builder :: the first axis is not valid.") +try: + MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2) +except myExcept as ec: + assert(ec.what() == "Multitranslation builder :: the first axis is not valid") # Pas d'exception levee alors qu'une devrait y en avoir une try: MultiTranslation_7 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., 5, ax2, 10., -2) except myExcept as ec: assert(ec.what() == "Multitranslation builder :: the number of copies for the second direction is null or negative.") +try: + MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., -2, ax2, 10., 5) +except myExcept as ec: + assert(ec.what() == "Multitranslation builder :: the number of copies for the first direction is null or negative.") -#try: -# MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5) -#except myExcept,ec: -# assert(ec.what() == "Multitranslation builder :: the second axis is not valid.") +try: + MultiTranslation_9 = shaperpy.makeMultiTranslation(Box_8, None, 15., 5, ax2, 10., 5) +except myExcept as ec: + assert(ec.what() == "Multitranslation builder :: the first axis is not valid") + +try: + MultiTranslation_10 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5) +except myExcept as ec: + assert(ec.what() == "Multitranslation builder :: the second axis is not valid") -- 2.39.2