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(ini, xzip, None) 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)
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(ini, xzip, None) 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)
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(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(ini, xzip, None) names = sorted(zipfile.ZipFile(xzip).namelist()) self.assertEqual([ 'exposure.csv', 'exposure1.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)
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(ini, xzip, None) names = sorted(zipfile.ZipFile(xzip).namelist()) self.assertEqual( ['exposure.csv', 'exposure1.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)
def test_zip(self): # this is a case with .hdf5 files ini = os.path.join(os.path.dirname(case_18.__file__), 'job.ini') dtemp = tempfile.mkdtemp() xzip = os.path.join(dtemp, 'x.zip') zip_cmd(ini, xzip, None) 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_ssmLT(self): # zipping a directory containing a ssmLT.xml file dtemp = os.path.join(tempfile.mkdtemp(), 'inp') shutil.copytree(os.path.dirname(case_21.__file__), dtemp) zip_cmd(dtemp) shutil.rmtree(dtemp)
def test_zip_ssmLT(self): # zipping a directory containing a ssmLT.xml file dtemp = os.path.join(tempfile.mkdtemp(), 'inp') shutil.copytree(os.path.dirname(case_21.__file__), dtemp) zip_cmd(dtemp) shutil.rmtree(dtemp)