Fix Pro-Gen unit test

This commit is contained in:
Nick Hall 2017-07-18 00:06:30 +01:00
parent 0b617e9fd6
commit 849290a3b7
3 changed files with 11 additions and 9 deletions

View File

@ -8,13 +8,13 @@
</researcher>
</header>
<tags>
<tag handle="_0000000100000001" change="1" name="Person Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000200000002" change="1" name="Family Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000300000003" change="1" name="Event Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000400000004" change="1" name="Place Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000500000005" change="1" name="Source Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000600000006" change="1" name="Citation Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000700000007" change="1" name="Note Pro-Gen Import (SAMPLE.DEF) 2017-06-25" color="#000000000000" priority="0"/>
<tag handle="_0000000100000001" change="1" name="Person Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
<tag handle="_0000000200000002" change="1" name="Family Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
<tag handle="_0000000300000003" change="1" name="Event Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
<tag handle="_0000000400000004" change="1" name="Place Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
<tag handle="_0000000500000005" change="1" name="Source Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
<tag handle="_0000000600000006" change="1" name="Citation Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
<tag handle="_0000000700000007" change="1" name="Note Pro-Gen Import (SAMPLE.DEF) 1999-12-25" color="#000000000000" priority="0"/>
</tags>
<events>
<event handle="_0000000b0000000b" change="1" id="E0000">

View File

@ -208,7 +208,7 @@ class ProgenOptions(ManagedWindow):
# initial values
fname = os.path.basename(filename).split('\\')[-1]
date = time.strftime("%Y-%m-%d")
date = time.strftime("%Y-%m-%d", time.localtime())
text = "Pro-Gen Import"
# add import source title/confidence

View File

@ -198,10 +198,12 @@ def make_tst_function(tstfile, file_name):
@patch('gramps.plugins.db.bsddb.write.time')
@patch('gramps.gen.utils.unknown.localtime')
@patch('gramps.gen.utils.unknown.time')
def tst(self, mocktime, mockltime, mockwtime, mockdtime):
@patch('time.localtime')
def tst(self, mockptime, mocktime, mockltime, mockwtime, mockdtime):
""" This compares the import file with the expected result '.gramps'
file.
"""
mockptime.side_effect = mock_localtime
mocktime.side_effect = mock_time
mockltime.side_effect = mock_localtime
mockwtime.side_effect = mock_time