safe.common.test.test_utilities module

InaSAFE Disaster risk assessment tool developed by AusAid -
Utilities Tests implementation.

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.common.test.test_utilities.TestUtilities(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_add_to_list()[source]

Test for add_to_list function

test_color_ramp()[source]

Test for color_ramp function.

test_create_classes()[source]

Test create_classes.

test_create_label()[source]

Test create label.

test_format_decimal()[source]

Test Format Decimal

test_format_int()[source]

Test formatting integer

test_get_non_conflicting_attribute_name()[source]

Test we can get a non conflicting attribute name.

test_get_significant_decimal()[source]

Test Get Significant Decimal

test_get_utm_epsg()[source]

Test we can get correct epsg code

test_humanize_class()[source]

Test humanize class First class interval < 1 Interval > 1

test_humanize_class2()[source]

Test humanize class 2 First class interval > 1 Interval > 1

test_humanize_class3()[source]

Test humanize class 3 First class interval < 1 Interval < 1

test_humanize_class4()[source]

Test humanize class 4 First class interval > 1 Interval < 1

test_humanize_class5()[source]

Test humanize class 5 First class interval < 1 Interval > 1

test_humanize_class6()[source]

Test humanize class 5 First class interval < 1 Interval > 1

test_humanize_size()[source]

Test we can convert size values to human readable size.

test_log_file_path()[source]

Test the log_file_path returns correct path.

test_romanise()[source]

Test we can convert MMI values to float.

test_separator()[source]

Test decimal and thousand separator

safe.common.test.test_utilities.print_class(array, result_class, expected_result)[source]

Print array, result_class, expected_result in nice format.

Parameters:
  • array (list) – The original array.
  • result_class (list) – The class result.
  • expected_result (list) – The expected result.