* src/plugins/TestcaseGenerator.py (fill_object): Use integer
confidence level. svn: r7319
This commit is contained in:
parent
1cc972b9a2
commit
66fa8dbbfd
@ -1,4 +1,6 @@
|
|||||||
2006-09-12 Alex Roitman <shura@gramps-project.org>
|
2006-09-12 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/plugins/TestcaseGenerator.py (fill_object): Use integer
|
||||||
|
confidence level.
|
||||||
* src/DateHandler/_Date_fr.py (DateParserFR.init_strings): Typo.
|
* src/DateHandler/_Date_fr.py (DateParserFR.init_strings): Typo.
|
||||||
* src/const.py.in (app_gramps): Revert to using a string.
|
* src/const.py.in (app_gramps): Revert to using a string.
|
||||||
|
|
||||||
|
@ -1186,7 +1186,7 @@ class TestcaseGenerator(Tool.Tool):
|
|||||||
if randint(0,1) == 1:
|
if randint(0,1) == 1:
|
||||||
(year, d) = self.rand_date( )
|
(year, d) = self.rand_date( )
|
||||||
o.set_date_object( d)
|
o.set_date_object( d)
|
||||||
o.set_confidence_level( self.rand_type(Utils.confidence))
|
o.set_confidence_level(choice(Utils.confidence.keys()))
|
||||||
|
|
||||||
if issubclass(o.__class__,RelLib._UrlBase.UrlBase):
|
if issubclass(o.__class__,RelLib._UrlBase.UrlBase):
|
||||||
while randint(0,1) == 1:
|
while randint(0,1) == 1:
|
||||||
@ -1235,13 +1235,7 @@ class TestcaseGenerator(Tool.Tool):
|
|||||||
return (year, event_ref)
|
return (year, event_ref)
|
||||||
|
|
||||||
def rand_type( self, list):
|
def rand_type( self, list):
|
||||||
if type(list) == dict:
|
if issubclass( list.__class__, RelLib.GrampsType):
|
||||||
key = choice(list.keys())
|
|
||||||
value = list[key]
|
|
||||||
if value == _("Custom"):
|
|
||||||
value = self.rand_text(self.SHORT)
|
|
||||||
return( (key,value))
|
|
||||||
elif issubclass( list.__class__, RelLib.GrampsType):
|
|
||||||
map = list.get_map()
|
map = list.get_map()
|
||||||
key = choice( map.keys())
|
key = choice( map.keys())
|
||||||
if key == list.get_custom():
|
if key == list.get_custom():
|
||||||
|
Loading…
Reference in New Issue
Block a user