From: akl Date: Wed, 26 Mar 2014 14:03:47 +0000 (+0400) Subject: Check that the given value for 'Representation' property is available. X-Git-Tag: V7_4_0rc1~4^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8ab1c94eae696e7b1bbe13301dba3620be745589;p=modules%2Fparavis.git Check that the given value for 'Representation' property is available. --- diff --git a/test/VisuPrs/Util/paravistest.py b/test/VisuPrs/Util/paravistest.py index 8083283a..9bc2f5ad 100755 --- a/test/VisuPrs/Util/paravistest.py +++ b/test/VisuPrs/Util/paravistest.py @@ -159,12 +159,19 @@ def get_picture_dir(subdir): def call_and_check(prs, property_name, value, do_raise=1, compare_toler=-1.0): """Utility function for 3D viewer test for common check of different types of presentation parameters set""" - try: - prs.SetPropertyWithName(property_name, value) - except ValueError: - error_string = (str(value) + "value of " + property_name + " is not available for this type of presentations") + if property_name == 'Representation': + if value in prs.GetProperty('RepresentationTypesInfo'): + prs.SetPropertyWithName(property_name, value) + error_string = None + else: + error_string = (str(value) + " value of " + property_name + " is not available for this type of presentations") else: - error_string = None + try: + prs.SetPropertyWithName(property_name, value) + except ValueError: + error_string = (str(value) + "value of " + property_name + " is not available for this type of presentations") + else: + error_string = None is_good = (error_string is None) if not is_good: if do_raise: