Skip to content

Instantly share code, notes, and snippets.

@timlinux
Created June 21, 2016 08:36
Show Gist options
  • Select an option

  • Save timlinux/0b0abe80a276a4bd6ee69ad9c5fca7cf to your computer and use it in GitHub Desktop.

Select an option

Save timlinux/0b0abe80a276a4bd6ee69ad9c5fca7cf to your computer and use it in GitHub Desktop.
======================================================================
ERROR: test_layer_legend_index (safe.gui.widgets.test.test_dock.TestDock)
Test we can get the legend index for a layer.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 345, in test_layer_legend_index
index = self.dock.layer_legend_index(layer)
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/dock.py", line 1334, in layer_legend_index
layer_id = layer.id()
AttributeError: 'NoneType' object has no attribute 'id'
======================================================================
ERROR: test_rubber_bands (safe.gui.widgets.test.test_dock.TestDock)
Test that the rubber bands get updated.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 908, in test_rubber_bands
self.assertEqual(expected_vertex_count, next_band.numberOfVertices())
AttributeError: 'NoneType' object has no attribute 'numberOfVertices'
======================================================================
ERROR: test_bad_ascii_data (safe.storage.test.test_io.TestIO)
ASC raster files with bad data causes good error message
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/storage/test/test_io.py", line 1421, in test_bad_ascii_data
read_layer(asc_filename)
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/storage/core.py", line 28, in read_layer
return Raster(filename)
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/storage/raster.py", line 107, in __init__
self.read_from_file(data)
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/storage/raster.py", line 182, in read_from_file
fid = self.fid = gdal.Open(filename, gdal.GA_ReadOnly)
RuntimeError: Couldn't find data values in ASCII Grid file.
======================================================================
FAIL: test_mmi_to_shapefile (safe.gui.tools.shake_grid.test.test_shake_grid.ShakeGridTest)
Check we can convert the shake event to a shapefile.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/tools/shake_grid/test/test_shake_grid.py", line 186, in test_mmi_to_shapefile
self.assertTrue(os.path.exists(file_path))
AssertionError: False is not true
======================================================================
FAIL: test_generate_reports (safe.gui.tools.test.test_impact_merge_dialog.ImpactMergeDialogTest)
Test generate_reports function.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/tools/test/test_impact_merge_dialog.py", line 571, in test_generate_reports
self.assertEqual(len(report_list), expected_reports_number)
AssertionError: 0 != 3
======================================================================
FAIL: test_merge (safe.gui.tools.test.test_impact_merge_dialog.ImpactMergeDialogTest)
Test merge function.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/tools/test/test_impact_merge_dialog.py", line 404, in test_merge
self.assertEqual(len(report_list), expected_reports_number)
AssertionError: 0 != 3
======================================================================
FAIL: test_relative_path (safe.gui.tools.test.test_save_scenario.SaveScenarioTest)
Test we calculate the relative paths correctly when saving scenario.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/tools/test/test_save_scenario.py", line 168, in test_relative_path
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Classified Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_save_scenario (safe.gui.tools.test.test_save_scenario.SaveScenarioTest)
Test saving Current scenario.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/tools/test/test_save_scenario.py", line 109, in test_save_scenario
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Classified Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_validate_input (safe.gui.tools.test.test_save_scenario.SaveScenarioTest)
Test validate input.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/tools/test/test_save_scenario.py", line 90, in test_validate_input
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Classified Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_add_above_layer (safe.gui.widgets.test.test_dock.TestDock)
Test we can add one layer above another - see #2322
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 366, in test_add_above_layer
self.assertIn(new_layer.id(), id_list)
AssertionError: u'foo20160621101656733' not found in [u'potential_idp20160621101656304', u'building_points20160621101656321', u'buildings20160621101656337', u'census20160621101656352', u'volcano_point20160621101656364', u'roads20160621101656377', u'flood_multipart_polygons20160621101656394', u'floods20160621101656409', u'classified_generic_polygon20160621101656422', u'volcano_krb20160621101656435', u'pop_binary_raster_20_2020160621101656448', u'classified_flood_20_2020160621101656461', u'continuous_flood_20_2020160621101656475', u'tsunami_wgs8420160621101656487', u'earthquake20160621101656500', u'district_osm_jakarta20160621101656513']
======================================================================
FAIL: test_cbo_aggregation_toggle (safe.gui.widgets.test.test_dock.TestDock)
Aggregation Combobox toggles on and off as expected.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 846, in test_cbo_aggregation_toggle
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected when an aggregation layer is defined.
======================================================================
FAIL: test_defaults (safe.gui.widgets.test.test_dock.TestDock)
Test the GUI in its default state
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 123, in test_defaults
self.assertEqual(self.dock.cboHazard.currentIndex(), 0)
AssertionError: 5 != 0
======================================================================
FAIL: test_full_run_qgszstats (safe.gui.widgets.test.test_dock.TestDock)
Aggregation results are correct using native QGIS zonal stats.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 643, in test_full_run_qgszstats
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_has_parameters_button_enabled (safe.gui.widgets.test.test_dock.TestDock)
Function configuration button is enabled when layers are compatible.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 794, in test_has_parameters_button_enabled
'Expected configuration options button to be enabled')
AssertionError: Expected configuration options button to be enabled
======================================================================
FAIL: test_insufficient_overlap (safe.gui.widgets.test.test_dock.TestDock)
Test Insufficient overlap errors are caught.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 172, in test_insufficient_overlap
self.assertTrue(button.isEnabled(), message)
AssertionError: Run button was not enabled
======================================================================
FAIL: test_issue1191 (safe.gui.widgets.test.test_dock.TestDock)
Test setting a layer's title in the kw directly from qgis api
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 1003, in test_issue1191
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Earthquake
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_issue306 (safe.gui.widgets.test.test_dock.TestDock)
Issue306: CANVAS doesnt add generated layers in tests.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 313, in test_issue306
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_issue317 (safe.gui.widgets.test.test_dock.TestDock)
Points near the edge of a raster hazard layer are interpolated OK
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 761, in test_issue317
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_issue47 (safe.gui.widgets.test.test_dock.TestDock)
Issue47: Hazard & exposure data are in different proj to viewport.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 283, in test_issue47
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_issue581 (safe.gui.widgets.test.test_dock.TestDock)
Test issue #581 in github - Humanize can produce IndexError : list
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 532, in test_issue581
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_new_layers_show_in_canvas (safe.gui.widgets.test.test_dock.TestDock)
Check that when we add a layer we can see it in the canvas list.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 746, in test_new_layers_show_in_canvas
self.assertTrue(before_count == after_count - 1, message)
AssertionError: Layer was not added to canvas (0 before, 0 after)
======================================================================
FAIL: test_result_styling (safe.gui.widgets.test.test_dock.TestDock)
Test that colours and opacity from a model are correctly styled.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/gui/widgets/test/test_dock.py", line 239, in test_result_styling
self.assertTrue(result, message)
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_run (safe.impact_functions.inundation.tsunami_raster_landcover.test.test_tsunami_raster_landcover.TestClassifiedPolygonLandCoverFunction)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_functions/inundation/tsunami_raster_landcover/test/test_tsunami_raster_landcover.py", line 81, in test_run
self.assertEqual(value, result, msg)
AssertionError: (u'Population', u'Medium Hazard Zone') is different than 156692.3, I got 807.7
======================================================================
FAIL: test_aggregation_attribute_in_keywords (safe.impact_statistics.test.test_aggregator.AggregatorTest)
Aggregation attribute is chosen correctly when present in keywords.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_statistics/test/test_aggregator.py", line 128, in test_aggregation_attribute_in_keywords
assert result, message
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_combo_aggregation_loaded_project (safe.impact_statistics.test.test_aggregator.AggregatorTest)
Aggregation combo changes properly according loaded layers
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_statistics/test/test_aggregator.py", line 111, in test_combo_aggregation_loaded_project
self.assertEquals(current_layers, layer_list, message)
AssertionError: The aggregation combobox should have:
[u'Entire area', u"D\xedstr\xedct's of Jakarta"]
Found: [u'Entire area']
======================================================================
FAIL: test_line_aggregation (safe.impact_statistics.test.test_aggregator.AggregatorTest)
Test if line aggregation works
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_statistics/test/test_aggregator.py", line 525, in test_line_aggregation
impact_layer_attributes=impact_layer_attributes)
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_statistics/test/test_aggregator.py", line 364, in _aggregate
impact_layer_attributes
AssertionError: Lists differ: [[{'KAB_NAME': u'JAKARTA BARAT!= [[{'KAB_NAME': u'JAKARTA BARAT...
First differing element 0:
[{'KAB_NAME': u'JAKARTA BARAT', 'flooded': 0.0, 'length': 7230.86465413803, 'id': 2, 'aggr_sum': 7230.86465413803}]
[{'KAB_NAME': u'JAKARTA BARAT', 'flooded': 0.0, 'length': 7230.864654, 'id': 2, 'aggr_sum': 7230.864654}]
[[{'KAB_NAME': u'JAKARTA BARAT',
- 'aggr_sum': 7230.86465413803,
? -----
+ 'aggr_sum': 7230.864654,
'flooded': 0.0,
'id': 2,
- 'length': 7230.86465413803}],
? -----
+ 'length': 7230.864654}],
[{'KAB_NAME': u'JAKARTA PUSAT',
- 'aggr_sum': 4356.161093237245,
? ------
+ 'aggr_sum': 4356.161093,
- 'flooded': 4356.161093237245,
? ------
+ 'flooded': 4356.161093,
'id': 3,
- 'length': 4356.161093237245}],
? ------
+ 'length': 4356.161093}],
[{'KAB_NAME': u'JAKARTA SELATAN',
- 'aggr_sum': 3633.3172872453138,
? -------
+ 'aggr_sum': 3633.317287,
'flooded': 0.0,
'id': 4,
- 'length': 3633.3172872453138}],
? -------
+ 'length': 3633.317287}],
[{'KAB_NAME': u'JAKARTA UTARA',
- 'aggr_sum': 4985.831677438495,
? ------
+ 'aggr_sum': 4985.831677,
- 'flooded': 4985.831677438495,
? ------
+ 'flooded': 4985.831677,
'id': 1,
- 'length': 4985.831677438495}],
? ------
+ 'length': 4985.831677}],
[{'KAB_NAME': u'JAKARTA TIMUR',
- 'aggr_sum': 4503.033628994946,
? - -----
+ 'aggr_sum': 4503.033629,
'flooded': 0.0,
'id': 4,
- 'length': 4503.033628994946},
? - -----
+ 'length': 4503.033629},
{'KAB_NAME': u'JAKARTA TIMUR',
- 'aggr_sum': 5809.1422469723475,
? -- -----
+ 'aggr_sum': 5809.142247,
- 'flooded': 5809.1422469723475,
? -- -----
+ 'flooded': 5809.142247,
'id': 1,
- 'length': 5809.1422469723475}]]
? -- -----
+ 'length': 5809.142247}]]
======================================================================
FAIL: test_check_postprocessing_layers_visibility (safe.impact_statistics.test.test_postprocessor_manager.PostprocessorManagerTest)
Generated layers are not added to the map registry.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_statistics/test/test_postprocessor_manager.py", line 90, in test_check_postprocessing_layers_visibility
assert result, message
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_post_processor_output (safe.impact_statistics.test.test_postprocessor_manager.PostprocessorManagerTest)
Check that the post processor does not add spurious report rows.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/impact_statistics/test/test_postprocessor_manager.py", line 141, in test_post_processor_output
assert result, message
AssertionError:
Hazard Layer Not Found: Continuous Flood
Combo State:
Hazard Layers
-------------------------
Exposure Layers
-------------------------
Functions
-------------------------
Aggregation Layers
-------------------------
>> Entire area
>> means combo item is selected
======================================================================
FAIL: test_clip_geometry (safe.utilities.test.test_clipper.ClipperTest)
Test that we can clip a geometry using another geometry.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/timlinux/.qgis2/python/plugins/inasafe/safe/utilities/test/test_clipper.py", line 570, in test_clip_geometry
assert compare_wkt(expected_wkt, str(result.exportToWkt()))
AssertionError
----------------------------------------------------------------------
Ran 511 tests in 1050.868s
FAILED (failures=26, errors=3, expected failures=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment