Commit 41d7fc2b authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent 05b3d77d
......@@ -45,11 +45,10 @@ def shortcuts(field: QgsField) -> typing.List[LabelShortcutType]:
"""
assert isinstance(field, QgsField)
shortCutsString = [LabelShortcutType.Sensor, LabelShortcutType.Date,
shortCutsString = [LabelShortcutType.Sensor, LabelShortcutType.Date, LabelShortcutType.Time,
LabelShortcutType.DateTime, LabelShortcutType.SourceImage]
shortCutsInt = [LabelShortcutType.Year, LabelShortcutType.DOY]
shortCutsFloat = [LabelShortcutType.Year, LabelShortcutType.DOY, LabelShortcutType.DecimalYear]
#shortCutsDate = [LabelShortcutType.Year, LabelShortcutType.Date, LabelShortcutType.DateTime]
options = [LabelShortcutType.Off]
fieldType = field.type()
......
......@@ -21,13 +21,16 @@ import unittest
import xmlrunner
from qgis.core import QgsVectorLayer, QgsField, QgsEditorWidgetSetup, QgsProject, \
QgsFields
from qgis.gui import QgsDualView, QgsEditorConfigWidget, QgsMapLayerStyleManagerWidget, \
QgsMapCanvas, QgsGui, QgsEditorWidgetRegistry, QgsEditorWidgetWrapper
from eotimeseriesviewer.docks import LabelDockWidget, SpectralLibraryDockWidget
from eotimeseriesviewer.labeling import *
from eotimeseriesviewer.mapcanvas import MapCanvas
from eotimeseriesviewer.mapvisualization import MapView
from eotimeseriesviewer.tests import TestObjects, EOTSVTestCase
from qgis.core import QgsVectorLayer, QgsField, QgsEditorWidgetSetup, QgsProject, \
QgsFields, QgsEditorWidgetRegistry, QgsEditorWidgetWrapper
from qgis.gui import QgsDualView, QgsEditorConfigWidget, QgsMapLayerStyleManagerWidget, QgsMapCanvas, QgsGui
class TestLabeling(EOTSVTestCase):
......@@ -123,8 +126,6 @@ class TestLabeling(EOTSVTestCase):
elif re.search('real', field.typeName(), re.I):
for t in [LabelShortcutType.Off, LabelShortcutType.DOY]:
self.assertTrue(t in possibleTypes)
else:
self.fail('Unhandled QgsField typeName: {}'.format(field.typeName()))
def test_LabelShortcutEditorConfigWidget(self):
print('## test_LabelShortcutEditorConfigWidget')
......
......@@ -150,21 +150,7 @@ class TestSettings(EOTSVTestCase):
for k in ['nb', 'px_size_x', 'px_size_y', 'dt', 'wl', 'wlu', 'name']:
self.assertTrue(k in jsonDict.keys())
oldname0 = sensorName(sensorID)
sensor = SensorInstrument(sensorID)
oldname = sensor.name()
if oldname0 is not None:
self.assertEqual(oldname0, oldname, )
self.assertIsInstance(oldname, str)
self.assertIsInstance(sensor, SensorInstrument)
name1 = 'S1' + str(uuid.uuid4())
sensor.setName(name1)
sensor.setName(oldname)
name2 = sensorName(sensorID)
#self.assertEqual(oldname, name2)
# removed: should be done by project settings
if __name__ == "__main__":
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'), buffer=False)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment