-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
*.orig | ||
*.rej | ||
# Temp files | ||
*~ | ||
*.o | ||
*.swp | ||
*.pyc | ||
*.DS_Store | ||
*.zip | ||
help/ | ||
i18n/ | ||
scripts/ | ||
test/ | ||
.idea/ | ||
|
||
# Tests data | ||
symbology-style.db | ||
|
||
# IDE | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__copyright__ = 'Copyright 2024, 3Liz' | ||
__license__ = 'GPL version 3' | ||
__email__ = 'info@3liz.org' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
__copyright__ = 'Copyright 2024, 3Liz' | ||
__license__ = 'GPL version 3' | ||
__email__ = 'info@3liz.org' | ||
|
||
import unittest | ||
|
||
from qgis.core import QgsApplication | ||
|
||
|
||
class BaseTests(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
cls.qgs = QgsApplication([], False) | ||
cls.qgs.initQgis() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
cls.qgs.exitQgis() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "lines", | ||
"features": [ | ||
{ "type": "Feature", "properties": { "id": 1, "name": "1 Name" }, "geometry": { "type": "LineString", "coordinates": [ [ 3.8540, 43.6220 ], [ 3.8970, 43.6220 ] ] } }, | ||
{ "type": "Feature", "properties": { "id": 2, "name": "2 Name" }, "geometry": { "type": "LineString", "coordinates": [ [ 3.8540, 43.5786 ], [ 3.8970, 43.5786 ] ] } } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "lines", | ||
"features": [ | ||
{ "type": "Feature", "properties": { "id": 1, "name": "1 Name" }, "geometry": { "type": "LineString", "coordinates": [ [ 3.8540, 43.6220 ], [ 3.8540, 43.5786 ] ] } }, | ||
{ "type": "Feature", "properties": { "id": 2, "name": "2 Name" }, "geometry": { "type": "LineString", "coordinates": [ [ 3.8970, 43.6220 ], [ 3.8970, 43.5786 ] ] } } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
__copyright__ = 'Copyright 2024, 3Liz' | ||
__license__ = 'GPL version 3' | ||
__email__ = 'info@3liz.org' | ||
|
||
import unittest | ||
|
||
from pathlib import Path | ||
|
||
from qgis.core import QgsVectorLayer | ||
from qgis.core import QgsProject | ||
|
||
from tests.base_tests import BaseTests | ||
|
||
|
||
class TestBasicReplacement(BaseTests): | ||
|
||
def test_replacement_map_layer(self): | ||
""" Test datasource can be replaced. """ | ||
project = QgsProject() | ||
|
||
vector = QgsVectorLayer(str(Path("fixtures/folder_1/lines.geojson")), "Layer 1") | ||
project.addMapLayer(vector) | ||
self.assertEqual(1, len(project.mapLayers())) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |