Exemplo n.º 1
0
 def test_detect_input_type_with_exposure(self):
     """
     An exposure file is detected correctly.
     """
     chunk = '''
     <?xml version="1.0"?>
     <nrml xmlns="http://openquake.org/xmlns/nrml/0.2"
           xmlns:gml="http://www.opengis.net/gml" gml:id="nrml">
       <exposurePortfolio gml:id="ep">
         <exposureList gml:id="LA01" assetCategory="buildings"
                       lossCategory="economic_loss">
     '''
     self.assertEqual("exposure", detect_input_type(chunk))
Exemplo n.º 2
0
 def test_detect_input_type_with_vulnerability(self):
     """
     An vulnerability file is detected correctly.
     """
     chunk = '''
     <?xml version="1.0"?>
     <nrml xmlns="http://openquake.org/xmlns/nrml/0.2"
           xmlns:gml="http://www.opengis.net/gml" gml:id="nrml">
       <vulnerabilityModel>
         <discreteVulnerabilitySet vulnerabilitySetID="HAZUS"
                                   assetCategory="buildings"
                                   lossCategory="economic_loss">
     '''
     self.assertEqual("vulnerability", detect_input_type(chunk))
Exemplo n.º 3
0
    def test_detect_input_type_with_gmpe_ltree(self):
        """
        A GMPE logic tree is detected correctly.
        """
        chunk = '''
        <?xml version="1.0" encoding="UTF-8"?>

        <nrml xmlns:gml="http://www.opengis.net/gml"
              xmlns="http://openquake.org/xmlns/nrml/0.2"
              gml:id="n1">
            <logicTreeSet>
                <logicTree id="lt1" tectonicRegion="Active Shallow Crust">
                    <logicTreeBranchSet branchingLevel="1"
                                        uncertaintyType="gmpeModel">
        '''
        self.assertEqual("lt_gmpe", detect_input_type(chunk))
Exemplo n.º 4
0
    def test_detect_input_type_with_source(self):
        """
        A source model file is detected correctly.
        """
        chunk = '''
        <?xml version='1.0' encoding='utf-8'?>
        <nrml xmlns:gml="http://www.opengis.net/gml"
              xmlns:qml="http://quakeml.org/xmlns/quakeml/1.1"
              xmlns="http://openquake.org/xmlns/nrml/0.2"
              gml:id="n1">

            <!-- sourceModel is a gml:Feature -->
            <sourceModel gml:id="sm1">
                <config/>
        '''
        self.assertEqual("source", detect_input_type(chunk))