-
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.
Merge pull request #72 from traveltime-dev/2023-01_fix-tiles
fix #54: exception with tiles actions
- Loading branch information
Showing
3 changed files
with
69 additions
and
14 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
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,41 @@ | ||
from qgis.PyQt.QtWidgets import QDockWidget, QTreeView | ||
from qgis.utils import iface | ||
|
||
from .base import TestCaseBase | ||
|
||
|
||
class MiscTest(TestCaseBase): | ||
"""Testing other features""" | ||
|
||
def test_loading_map_tiles(self): | ||
|
||
browser = iface.mainWindow().findChild(QDockWidget, "Browser") | ||
treeview = browser.findChild(QTreeView) | ||
model = treeview.model() | ||
|
||
# Hide the browser | ||
browser.setVisible(False) | ||
# Select the first item | ||
treeview.setCurrentIndex(model.index(0, 0)) | ||
|
||
self._feedback() | ||
|
||
# Ensure the browser is hidden | ||
self.assertFalse(browser.isVisible()) | ||
# Ensure the XYZ layer is not selected | ||
self.assertNotEqual( | ||
model.data(treeview.currentIndex()), | ||
"TravelTime - Lux", | ||
) | ||
|
||
# Use the action | ||
self.plugin.action_show_tiles.trigger() | ||
self._feedback() | ||
|
||
# Ensure the panel got shown | ||
self.assertTrue(browser.isVisible()) | ||
# Ensure the XYZ layer got selected | ||
self.assertEqual( | ||
model.data(treeview.currentIndex()), | ||
"TravelTime - Lux", | ||
) |