Skip to content
Permalink
Browse files

Add the bad layers test to cmake and fix it for renamed methods

  • Loading branch information
elpaso committed Oct 31, 2018
1 parent adc3b74 commit bd71df00549070dd1dde8e1c774d873a58a4fe80
Showing with 7 additions and 6 deletions.
  1. +1 −0 tests/src/python/CMakeLists.txt
  2. +6 −6 tests/src/python/test_qgsprojectbadlayers.py
@@ -55,6 +55,7 @@ ADD_PYTHON_TEST(PyQgsFieldComboBoxTest test_qgsfieldcombobox.py)
ADD_PYTHON_TEST(PyQgsFieldFormattersTest test_qgsfieldformatters.py)
ADD_PYTHON_TEST(PyQgsFillSymbolLayers test_qgsfillsymbollayers.py)
ADD_PYTHON_TEST(PyQgsProject test_qgsproject.py)
ADD_PYTHON_TEST(PyQgsProjectBadLayers test_qgsprojectbadlayers.py)
ADD_PYTHON_TEST(PyQgsFeatureIterator test_qgsfeatureiterator.py)
ADD_PYTHON_TEST(PyQgsFeedback test_qgsfeedback.py)
ADD_PYTHON_TEST(PyQgsFields test_qgsfields.py)
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsProject.
"""QGIS Unit tests for QgsProject bad layers handling.
.. 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
@@ -64,12 +64,12 @@ def test_project_roundtrip(self):
vector = list(p.mapLayersByName('lines'))[0]
raster = list(p.mapLayersByName('raster'))[0]
raster_copy = list(p.mapLayersByName('raster_copy'))[0]
self.assertTrue(vector.originalLayerXmlProperties() != '')
self.assertTrue(raster.originalLayerXmlProperties() != '')
self.assertTrue(raster_copy.originalLayerXmlProperties() != '')
self.assertTrue(vector.originalXmlProperties() != '')
self.assertTrue(raster.originalXmlProperties() != '')
self.assertTrue(raster_copy.originalXmlProperties() != '')
# Test setter
raster.setOriginalLayerXmlProperties('pippo')
self.assertEqual(raster.originalLayerXmlProperties(), 'pippo')
raster.setOriginalXmlProperties('pippo')
self.assertEqual(raster.originalXmlProperties(), 'pippo')

# Now create and invalid project:
bad_project_path = os.path.join(temp_dir.path(), 'project_bad.qgs')

0 comments on commit bd71df0

Please sign in to comment.
You can’t perform that action at this time.