Ejemplo n.º 1
0
    def test_runEarthquakeFatalityFunction_small(self):
        """Padang 2009 fatalities estimated correctly (small extent)."""

        # Push OK with the left mouse button
        set_canvas_crs(GEOCRS, True)
        set_padang_extent()

        myResult, myMessage = setup_scenario(
            DOCK,
            hazard=PADANG2009_title,
            exposure='People',
            function='Earthquake Fatality Function',
            function_id='Earthquake Fatality Function')
        assert myResult, myMessage

        DOCK.accept()

        myResult = DOCK.wvResults.page_to_text()

        # Check against expected output
        myMessage = ('Unexpected result returned for Earthquake Fatality '
                     'Function Expected: fatality count of '
                     '116 , received: \n %s' % myResult)
        assert format_int(116) in myResult, myMessage

        myMessage = ('Unexpected result returned for Earthquake Fatality '
                     'Function Expected: total population count of '
                     '847529 , received: \n %s' % myResult)
        assert format_int(847529) in myResult, myMessage
Ejemplo n.º 2
0
    def test_runEarthquakeFatalityFunction_small(self):
        """Padang 2009 fatalities estimated correctly (small extent)."""

        # Push OK with the left mouse button
        set_canvas_crs(GEOCRS, True)
        set_padang_extent()

        myResult, myMessage = setup_scenario(
            DOCK,
            hazard=PADANG2009_title,
            exposure='People',
            function='Earthquake Fatality Function',
            function_id='Earthquake Fatality Function')
        assert myResult, myMessage

        DOCK.accept()

        myResult = DOCK.wvResults.page_to_text()

        # Check against expected output
        myMessage = ('Unexpected result returned for Earthquake Fatality '
                     'Function Expected: fatality count of '
                     '116 , received: \n %s' % myResult)
        assert format_int(116) in myResult, myMessage

        myMessage = ('Unexpected result returned for Earthquake Fatality '
                     'Function Expected: total population count of '
                     '847529 , received: \n %s' % myResult)
        assert format_int(847529) in myResult, myMessage
Ejemplo n.º 3
0
    def test_runEarthQuakeGuidelinesFunction(self):
        """GUI runs with Shakemap 2009 and Padang Buildings"""

        # Push OK with the left mouse button
        set_canvas_crs(GEOCRS, True)
        set_padang_extent()

        myResult, myMessage = setup_scenario(
            DOCK,
            hazard=PADANG2009_title,
            exposure='Padang WGS84',
            function='Earthquake Guidelines Function',
            function_id='Earthquake Guidelines Function')
        assert myResult, myMessage

        DOCK.accept()
        myResult = DOCK.wvResults.page_to_text()
        # Expected output:
        #Buildings    Total
        #All:    3160
        #Low damage (10-25%):    0
        #Medium damage (25-50%):    0
        #Pre merge of clip on steroids branch:
        #High damage (50-100%):    3160
        # Post merge of clip on steoids branch:
        #High damage (50-100%):    2993
        myMessage = ('Unexpected result returned for Earthquake guidelines'
                     'function. Expected:\n "All" count of 2993, '
                     'received: \n %s' % myResult)
        assert format_int(2993) in myResult, myMessage
Ejemplo n.º 4
0
    def test_runEarthQuakeGuidelinesFunction(self):
        """GUI runs with Shakemap 2009 and Padang Buildings"""

        # Push OK with the left mouse button
        set_canvas_crs(GEOCRS, True)
        set_padang_extent()

        myResult, myMessage = setup_scenario(
            DOCK,
            hazard=PADANG2009_title,
            exposure='Padang WGS84',
            function='Earthquake Guidelines Function',
            function_id='Earthquake Guidelines Function')
        assert myResult, myMessage

        DOCK.accept()
        myResult = DOCK.wvResults.page_to_text()
        # Expected output:
        #Buildings    Total
        #All:    3160
        #Low damage (10-25%):    0
        #Medium damage (25-50%):    0
        #Pre merge of clip on steroids branch:
        #High damage (50-100%):    3160
        # Post merge of clip on steoids branch:
        #High damage (50-100%):    2993
        myMessage = ('Unexpected result returned for Earthquake guidelines'
                     'function. Expected:\n "All" count of 2993, '
                     'received: \n %s' % myResult)
        assert format_int(2993) in myResult, myMessage