safe.metadata.test.test_if_provenance_step module

InaSAFE Disaster risk assessment tool developed by AusAid - metadata module.

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.metadata.test.test_if_provenance_step.TestImpactFunctionProvenanceStep(methodName='runTest')[source]

Bases: unittest.case.TestCase

good_data = {'user': 'my_user', 'analysis_extent': [0, 1, 2, 2], 'gdal_version': '1.9.1', 'impact_function_id': 'IF_id', 'qgis_version': '2.4', 'finish_time': '20140714_061255', 'impact_pixel_size': '0.1', 'start_time': '20140714_060955', 'impact_function_version': '2.1', 'qt_version': '4.5', 'hazard_pixel_size': '0.2', 'hazard_layer': 'path/to/hazard/layer', 'exposure_pixel_size': '0.1', 'inasafe_version': '2.1', 'pyqt_version': '5.1', 'host_name': 'my_computer', 'parameter': {}, 'os': 'ubuntu 12.04', 'exposure_layer': 'path/to/exposure/layer'}
good_data_xml = '<provenance_step timestamp="2015-08-13T20:20:48.178268">\n<title>TEST title</title>\n<description>TEST description</description>\n<start_time>20140714_060955</start_time>\n<finish_time>20140714_061255</finish_time>\n<hazard_layer>path/to/hazard/layer</hazard_layer>\n<exposure_layer>path/to/exposure/layer</exposure_layer>\n<impact_function_id>IF_id</impact_function_id>\n<impact_function_version>2.1</impact_function_version>\n<host_name>my_computer</host_name>\n<user>my_user</user>\n<qgis_version>2.4</qgis_version>\n<gdal_version>1.9.1</gdal_version>\n<qt_version>4.5</qt_version>\n<pyqt_version>5.1</pyqt_version>\n<os>ubuntu 12.04</os>\n<inasafe_version>2.1</inasafe_version>\n<exposure_pixel_size>0.1</exposure_pixel_size>\n<hazard_pixel_size>0.2</hazard_pixel_size>\n<impact_pixel_size>0.1</impact_pixel_size>\n<analysis_extent>[0, 1, 2, 2]</analysis_extent>\n<parameter>{}</parameter>\n</provenance_step>\n'
test_invalid_data()[source]
test_xml()[source]