From f6a19173c4a63faf94d81bef97f57f730d15f1fc Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 13 Sep 2006 00:35:47 +0000 Subject: [PATCH] confidence level; (generate_date_tests): Remove invalid dates. svn: r7320 --- gramps2/ChangeLog | 2 +- gramps2/src/plugins/TestcaseGenerator.py | 90 ++++++++++++------------ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 95e0a2adb..8563bf8dc 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,6 @@ 2006-09-12 Alex Roitman * src/plugins/TestcaseGenerator.py (fill_object): Use integer - confidence level. + confidence level; (generate_date_tests): Remove invalid dates. * src/DateHandler/_Date_fr.py (DateParserFR.init_strings): Typo. * src/const.py.in (app_gramps): Revert to using a string. diff --git a/gramps2/src/plugins/TestcaseGenerator.py b/gramps2/src/plugins/TestcaseGenerator.py index 21a034b24..ecb996212 100644 --- a/gramps2/src/plugins/TestcaseGenerator.py +++ b/gramps2/src/plugins/TestcaseGenerator.py @@ -648,51 +648,51 @@ class TestcaseGenerator(Tool.Tool): "This is a textual date") dates.append( d) - # test invalid dates - dateval = (4,7,1789,False,5,8,1876,False) - for l in range(1,len(dateval)): - d = RelLib.Date() - try: - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") - dates.append( d) - except Errors.DateError, e: - d.set_as_text("Date identified value correctly as invalid.\n%s" % e) - dates.append( d) - except: - d = RelLib.Date() - d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) - dates.append( d) - for l in range(1,len(dateval)): - d = RelLib.Date() - try: - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN,RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") - dates.append( d) - except Errors.DateError, e: - d.set_as_text("Date identified value correctly as invalid.\n%s" % e) - dates.append( d) - except: - d = RelLib.Date() - d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,(44,7,1789,False),"Text comment") - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, - RelLib.Date.CAL_GREGORIAN,(4,77,1789,False),"Text comment") - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, - RelLib.Date.CAL_GREGORIAN, - (4,7,1789,False,55,8,1876,False),"Text comment") - dates.append( d) - d = RelLib.Date() - d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, - RelLib.Date.CAL_GREGORIAN, - (4,7,1789,False,5,88,1876,False),"Text comment") - dates.append( d) +## # test invalid dates +## dateval = (4,7,1789,False,5,8,1876,False) +## for l in range(1,len(dateval)): +## d = RelLib.Date() +## try: +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, +## RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") +## dates.append( d) +## except Errors.DateError, e: +## d.set_as_text("Date identified value correctly as invalid.\n%s" % e) +## dates.append( d) +## except: +## d = RelLib.Date() +## d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) +## dates.append( d) +## for l in range(1,len(dateval)): +## d = RelLib.Date() +## try: +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN,RelLib.Date.CAL_GREGORIAN,dateval[:l],"Text comment") +## dates.append( d) +## except Errors.DateError, e: +## d.set_as_text("Date identified value correctly as invalid.\n%s" % e) +## dates.append( d) +## except: +## d = RelLib.Date() +## d.set_as_text("Date.set Exception %s" % ("".join(traceback.format_exception(*sys.exc_info())),)) +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, +## RelLib.Date.CAL_GREGORIAN,(44,7,1789,False),"Text comment") +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_NONE, +## RelLib.Date.CAL_GREGORIAN,(4,77,1789,False),"Text comment") +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, +## RelLib.Date.CAL_GREGORIAN, +## (4,7,1789,False,55,8,1876,False),"Text comment") +## dates.append( d) +## d = RelLib.Date() +## d.set(RelLib.Date.QUAL_NONE,RelLib.Date.MOD_SPAN, +## RelLib.Date.CAL_GREGORIAN, +## (4,7,1789,False,5,88,1876,False),"Text comment") +## dates.append( d) # now add them as birth to new persons for dateval in dates: