def test_resfilename_is_not_none(self):
     __, options, parameters, data, covariance, rejected, chain, s2chain, sschain = gf.setup_mcmc_case_dr(
     )
     RS = ResultsStructure()
     RS.add_options(options=options)
     RS.results['simulation_options']['results_filename'] = 'test'
     filename = RS.determine_filename(
         options=RS.results['simulation_options'])
     self.assertEqual(filename, 'test', msg='Filename matches')
 def test_key_removal(self):
     options = SimulationOptions()
     options.define_simulation_options(doram=3, nsimu=500)
     RS = ResultsStructure()
     RS.add_options(options=options)
     self.assertEqual(RS.results['simulation_options']['nsimu'],
                      options.nsimu,
                      msg=str('nsimu = {}'.format(options.nsimu)))
     self.assertFalse('doram' in RS.results['simulation_options'].items(),
                      msg='doram option should not be saved')
 def test_resfilename_is_none(self):
     __, options, parameters, data, covariance, rejected, chain, s2chain, sschain = gf.setup_mcmc_case_dr(
     )
     RS = ResultsStructure()
     RS.add_options(options=options)
     RS.results['simulation_options']['results_filename'] = None
     filename = RS.determine_filename(
         options=RS.results['simulation_options'])
     self.assertEqual(filename,
                      str('{}{}{}'.format(
                          RS.results['simulation_options']['datestr'], '_',
                          'mcmc_simulation.json')),
                      msg='Filename matches')