### Navigation

- index
- modules
- next
- previous
- Home »
- Contents »
- InaSAFE’s API documentation »
- Package::safe_qgis_tests »

# 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')

  Test the InaSAFE GUI

  `setUp`()

    Fixture run before all tests

  `tearDown`()

    Fixture run after each test

  `test_Issue47`()

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

  `test_Issue71`()

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

  `test_Issue95`()

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

  `test_ResultStyling`()

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

  `test_cboAggregationEmptyProject`()

    Aggregation combo changes properly according loaded layers

  `test_cboAggregationToggle`(*args, **kwargs)

    Aggregation Combobox toggles on and off as expected.

  `test_defaults`()

    Test the GUI in its default state

  `test_issue317`()

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

  `test_issue45`()

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

  `test_issue_160`()

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

  `test_layerChanged`()

    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`()

    Layers can be loaded and list widget was updated appropriately

  `test_newLayersShowInCanvas`()

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

  `test_runCategorizedHazardBuildingImpact`()

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

  `test_runEarthQuakeGuidelinesFunction`()

    GUI runs with Shakemap 2009 and Padang Buildings

  `test_runEarthquakeFatalityFunction_Padang_full`()

    Padang 2009 fatalities estimated correctly (large extent)

  `test_runEarthquakeFatalityFunction_small`()

    Padang 2009 fatalities estimated correctly (small extent)

  `test_runFloodPopulationImpactFunction`()

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

  `test_runFloodPopulationImpactFunction_scaling`()

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

  `test_runFloodPopulationPolygonHazardImpactFunction`()

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

  `test_runTsunamiBuildingImpactFunction`()

    Tsunami function runs in GUI as expected.

  `test_setOkButtonStatus`()

    OK button changes properly according to DOCK validity

  `test_state`()

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

  `test_validate`()

    Validate function work as expected

`safe_qgis.test_dock.``canvasList`()

  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`(ui)

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

`safe_qgis.test_dock.``formattedList`(theList)

  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)

  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')

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

`safe_qgis.test_dock.``loadStandardLayers`()

  Helper function to load standard layers into the dialog.

`safe_qgis.test_dock.``populatemyDock`()

  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)

  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.

### Navigation

- index
- modules
- next
- previous
- Home »
- Contents »
- InaSAFE’s API documentation »
- Package::safe_qgis_tests »