# svir.test.unit package

## Submodules

## svir.test.unit.test_calculate_indices module

class `svir.test.unit.test_calculate_indices.``CalculateCompositeVariableTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_average`()
  `test_calculate_svi`()
  `test_custom_operator`()
  `test_geometric_mean_negative_argument`()
  `test_geometric_mean_positive_argument`()
  `test_simple_multiplication`()
  `test_simple_sum`()
  `test_weighted_multiplication`()
  `test_weighted_sum`()

`svir.test.unit.test_calculate_indices.``calculate_education_node`(proj_def, operator, layer)

  Use the calculate_node function to compute the ‘Education’ node using the given project definition and operator. The layer is updated as a side effect.

`svir.test.unit.test_calculate_indices.``write_output`(res_layer, data_dir_name, res_layer_name)

## svir.test.unit.test_init module

class `svir.test.unit.test_init.``TestInit`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  Test that the plugin init is usable for QGIS.

  Based heavily on the validator class by Alessandro Passoti available here:

  http://github.com/qgis/qgis-django/blob/master/qgis-app/
    plugins/validator.py
  `test_read_init`()

    Test that the plugin __init__ will validate on plugins.qgis.org.

## svir.test.unit.test_irmt module

class `svir.test.unit.test_irmt.``IrmtTest`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  Test OpenQuake IRMT works.

  `setUp`()

    Runs before each test.

  `tearDown`()

    Runs after each test.

  `test_icon_png`()

    Test we can click OK.

  `test_toggle_active_actions`()

## svir.test.unit.test_load_oq_engine_output_as_layer module

class `svir.test.unit.test_load_oq_engine_output_as_layer.``LoadOQEngineOutputAsLayerTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_load_ruptures`()

## svir.test.unit.test_loss_aggreagation module

class `svir.test.unit.test_loss_aggreagation.``AggregateLossByZoneTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `on_calculate_zonal_stats_finished`(output_zonal_layer)
  `setUp`()
  `test_sum_point_values_by_zone`()

## svir.test.unit.test_metadata_utilities module

InaSAFE Disaster risk assessment tool developed by AusAid - Exception Classes.

Custom exception classes for the IS application.

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 `svir.test.unit.test_metadata_utilities.``TestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `test_generate_iso_metadata`()
  `test_valid_iso_xml`()

## svir.test.unit.test_process_layer module

class `svir.test.unit.test_process_layer.``AddAttributesTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_add_attributes`()
  `test_find_attribute_id`()

class `svir.test.unit.test_process_layer.``CheckProjectionsTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_different_projections`()
  `test_same_projections`()

class `svir.test.unit.test_process_layer.``CompareLayerContentTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_same_content_case_first_layer_has_more_features`()
  `test_same_content_case_layers_are_completely_different`()
  `test_same_content_case_layers_are_equal`()
  `test_same_content_case_second_layer_has_more_features`()

## svir.test.unit.test_qgis_environment module

InaSAFE Disaster risk assessment tool developed by AusAid - ISClipper test suite.

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 `svir.test.unit.test_qgis_environment.``QGISTest`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  Test the QGIS Environment.

  `test_qgis_environment`()

    QGIS environment has the expected providers.

## svir.test.unit.test_recovery_modeling module

## svir.test.unit.test_transformations module

class `svir.test.unit.test_transformations.``Log10TestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_log10_all_positive_values`()
  `test_log10_incrementing_by_one_case_no_zeros_found`()
  `test_log10_incrementing_by_one_case_zeros_found`()
  `test_log10_with_negative_values`()
  `test_log10_with_zeros_unchanged`()

class `svir.test.unit.test_transformations.``MinMaxTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_min_max_direct`()
  `test_min_max_inverse`()

class `svir.test.unit.test_transformations.``MissingValuesTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `test_transform_with_missing_values`()

class `svir.test.unit.test_transformations.``QuadraticTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_quadratic_direct_decreasing`()
  `test_quadratic_direct_increasing`()
  `test_quadratic_inverse_decreasing`()
  `test_quadratic_inverse_increasing`()

class `svir.test.unit.test_transformations.``RankTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_rank_direct_average`()
  `test_rank_direct_dense`()
  `test_rank_direct_max`()
  `test_rank_direct_min`()
  `test_rank_direct_ordinal`()
  `test_rank_inverse_average`()
  `test_rank_inverse_dense`()
  `test_rank_inverse_max`()
  `test_rank_inverse_min`()
  `test_rank_inverse_ordinal`()

class `svir.test.unit.test_transformations.``SigmoidTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_sigmoid_direct`()
  `test_sigmoid_inverse`()
  `test_sigmoid_inverse_zero_division`()

class `svir.test.unit.test_transformations.``ZScoreTestCase`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  `setUp`()
  `test_z_score_direct`()
  `test_z_score_inverse`()

## svir.test.unit.test_translations module

Safe Translations Test.

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 `svir.test.unit.test_translations.``SafeTranslationsTest`(methodName='runTest')

  Bases: `qgis.testing.TestCase`

  Test translations work.

  `setUp`()

    Runs before each test.

  `tearDown`()

    Runs after each test.

  `test_qgis_translations`()

    Test that translations work.

## Module contents