safe.gui.tools.minimum_needs.test.test_minimum_needs_qsettings module

Minimum Needs Tool Test Cases.

InaSAFE Disaster risk assessment tool developed by AusAid and World Bank

Contact : christian@kartoza.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.gui.tools.minimum_needs.test.test_minimum_needs_qsettings.MinimumNeedsTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

Test class to test QMinimum needs.

setUp()[source]

Test initialisation run before each test.

tearDown()[source]

Run after each test.

test_01_loading_defaults()[source]

Test loading the defaults on a blank settings.

test_02_update_minimum_needs()[source]

Change minimum needs and verify that the result are updated.

test_03_root_directory()[source]
test_default_is_valid()[source]

Test that that if maximum is less than minimum causes error.

test_issue_2132()[source]

Test that floats are cast to strings for precision handler.

test_maximum_greater_than_minimum()[source]

Test that that if maximum is less than minimum causes error.

test_precision_of()[source]

Test determining precision of json file min needs resources.

class safe.gui.tools.minimum_needs.test.test_minimum_needs_qsettings.TestNeedsProfile(test_profile='Test Minimum Needs Settings')[source]

Bases: safe.gui.tools.minimum_needs.needs_profile.NeedsProfile

Since we don’t want to change the actual minimum needs settings in QSettings, we are using a mock profile.

Parameters:test_profile – The mock replacement of Minimum Needs