Module: safe_qgis.test_dock

InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - GUI Test Cases.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe_qgis.test_dock.DockTest(methodName='runTest')[source]

Test the InaSAFE GUI

Xtest_runnerExceptions()[source]

Test runner exceptions

Xtest_runnerIsNone()[source]

Test for none runner exceptions

setUp()[source]

Fixture run before all tests

tearDown()[source]

Fixture run after each test

test_Issue47()[source]

Issue47: Problem when hazard & exposure data are in different proj to viewport. See https://github.com/AIFDR/inasafe/issues/47

test_Issue71()[source]

Test issue #71 in github - cbo changes should update ok button.

test_Issue95()[source]

Test issue #95 in github -check crs of impact layer.

test_ResultStyling()[source]

Test that ouputs from a model are correctly styled (colours and opacity.

test_aggregationResults(*args, **kwargs)[source]

Aggregation results are correct.

test_cboAggregationEmptyProject()[source]

Aggregation combo changes properly according on no loaded layers

test_cboAggregationLoadedProject()[source]

Aggregation combo changes properly according loaded layers

test_cboAggregationToggle(*args, **kwargs)[source]

Aggregation Combobox toggles on and off as expected.

test_checkAggregationAttribute1Attr()[source]

Aggregation attribute is chosen correctly when there is only one attr available.

test_checkAggregationAttributeInKW()[source]

Aggregation attribute is chosen correctly when present in kezwords.

test_checkAggregationAttributeNoAttr()[source]

Aggregation attribute is chosen correctly when there is no attr available.

test_checkAggregationAttributeNoneAttr()[source]

Aggregation attribute is chosen correctly when there None in the kezwords

test_defaults()[source]

Test the GUI in its default state

test_hasParametersButtonDisabled()[source]

Function configuration button is disabled when layers not compatible.

test_hasParametersButtonEnabled()[source]

Function configuration button is enabled when layers are compatible.

test_issue317()[source]

Points near the edge of a raster hazard layer are interpolated OK

test_issue45()[source]

Points near the edge of a raster hazard layer are interpolated OK

test_issue_160()[source]

Test that multipart features can be used in a scenario - issue #160

test_layerChanged()[source]

Test the metadata is updated as the user highlights different QGIS layers. For inasafe outputs, the table of results should be shown See also https://github.com/AIFDR/inasafe/issues/58

test_loadLayers()[source]

Layers can be loaded and list widget was updated appropriately

test_newLayersShowInCanvas()[source]

Check that when we add a layer we can see it in the canvas list.

test_runCategorizedHazardBuildingImpact()[source]

Flood function runs in GUI with Flood in Jakarta hazard data Uses DKI buildings exposure data.

test_runEarthQuakeGuidelinesFunction()[source]

GUI runs with Shakemap 2009 and Padang Buildings

test_runEarthquakeFatalityFunction_Padang_full()[source]

Padang 2009 fatalities estimated correctly (large extent)

test_runEarthquakeFatalityFunction_small()[source]

Padang 2009 fatalities estimated correctly (small extent)

test_runFloodPopulationImpactFunction()[source]

Flood function runs in GUI with Jakarta data Raster on raster based function runs as expected.

test_runFloodPopulationImpactFunction_scaling()[source]

Flood function runs in GUI with 5x5km population data Raster on raster based function runs as expected with scaling.

test_runFloodPopulationPolygonHazardImpactFunction()[source]

Flood function runs in GUI with Jakarta polygon flood hazard data. Uses population raster exposure layer

test_runTsunamiBuildingImpactFunction()[source]

Tsunami function runs in GUI as expected.

test_setOkButtonStatus()[source]

OK button changes properly according to DOCK validity

test_state()[source]

Check if the save/restore state methods work. See also https://github.com/AIFDR/inasafe/issues/58

test_validate()[source]

Validate function work as expected

safe_qgis.test_dock.canvasList()[source]

Return a string representing the list of canvas layers (in correct order) but formatted with line breaks between each entry.

safe_qgis.test_dock.combosToString(theUi)[source]

Helper to return a string showing the state of all combos (all their entries

safe_qgis.test_dock.formattedList(theList)[source]

Return a string representing a list of layers (in correct order) but formatted with line breaks between each entry.

safe_qgis.test_dock.getUiState(ui)[source]

Get state of the 3 combos on the DOCK ui. This method is purely for testing and not to be confused with the saveState and restoreState methods of inasafedock.

safe_qgis.test_dock.loadLayers(theLayerList, theClearFlag=True, theDataDirectory='/home/timlinux/dev/python/inasafe_data/test')[source]

Helper function to load layers as defined in a python list.

safe_qgis.test_dock.loadStandardLayers()[source]

Helper function to load standard layers into the dialog.

safe_qgis.test_dock.populatemyDock()[source]

A helper function to populate the DOCK and set it to a valid state.

safe_qgis.test_dock.setupScenario(theHazard, theExposure, theFunction, theFunctionId, theOkButtonFlag=True, theAggregation=None, theAggregationEnabledFlag=None)[source]

Helper function to set the gui state to a given scenario.

Args:

theHazard str - (Required) name of the hazard combo entry to set. theExposure str - (Required) name of exposure combo entry to set. theFunction - (Required) name of the function combo entry to set. theFunctionId - (Required) the impact function id that should be used. theOkButtonFlag - (Optional) Whether the ok button should be enabled

after this scenario is set up.

theAggregationLayer - (Optional) which layer should be used for aggregation

We require both theFunction and theFunctionId because safe allows for multiple functions with the same name but different id’s so we need to be sure we have the right one.

Returns: bool - Indicating if the setup was successful
str - A message indicating why it may have failed.

Raises: None

This module forms part of the InaSAFE tool.

Previous topic

Module: safe_qgis.test_clipper

Next topic

Module: safe_qgis.test_map_legend

This Page