Beispiel #1
0
 def test_zip_gmf_ebrisk(self):
     # this is a case without gsims and with a gmf file
     ini = os.path.join(os.path.dirname(ebrisk.__file__), 'job_risk.ini')
     dtemp = tempfile.mkdtemp()
     xzip = os.path.join(dtemp, 'x.zip')
     zip_cmd.func(ini, xzip)
     names = sorted(zipfile.ZipFile(xzip).namelist())
     self.assertEqual(['exposure_model.xml', 'gmf_scenario.csv',
                       'job_risk.ini', 'sites.csv', 'vulnerability.xml'],
                      names)
     shutil.rmtree(dtemp)
Beispiel #2
0
 def test_zip(self):
     ini = os.path.join(os.path.dirname(case_18.__file__), 'job.ini')
     dtemp = tempfile.mkdtemp()
     xzip = os.path.join(dtemp, 'x.zip')
     zip_cmd.func(ini, xzip)
     names = sorted(zipfile.ZipFile(xzip).namelist())
     self.assertEqual([
         'Wcrust_high_rhypo.hdf5', 'Wcrust_low_rhypo.hdf5',
         'Wcrust_med_rhypo.hdf5', 'job.ini', 'nbc_asc_logic_tree.xml',
         'source_model_logic_tree.xml', 'vancouver_area_source.xml',
         'vancouver_school_sites.csv'
     ], names)
     shutil.rmtree(dtemp)
 def test_zip_ebr(self):
     # this is a case with an exposure.csv
     ini = os.path.join(os.path.dirname(case_exposure.__file__), 'job.ini')
     dtemp = tempfile.mkdtemp()
     xzip = os.path.join(dtemp, 'x.zip')
     zip_cmd.func(ini, xzip, None)
     names = sorted(zipfile.ZipFile(xzip).namelist())
     self.assertEqual([
         'exposure.csv', 'exposure.xml', 'gmpe_logic_tree.xml', 'job.ini',
         'source_model.xml', 'source_model_logic_tree.xml',
         'vulnerability_model_nonstco.xml', 'vulnerability_model_stco.xml'
     ], names)
     shutil.rmtree(dtemp)