Commit 08fe1d3 1 parent 85c0dbb commit 08fe1d3 Copy full SHA for 08fe1d3
File tree 1 file changed +56
-0
lines changed
1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ from qgis .PyQt import QtWidgets
2
+ from ee_plugin .ui import utils , forms
3
+
4
+
5
+ def test_get_values ():
6
+ dialog = forms .build_vbox_dialog (
7
+ widgets = [
8
+ forms .build_form_group_box (
9
+ rows = [
10
+ (
11
+ "Label" ,
12
+ QtWidgets .QLineEdit (objectName = "line_edit" ),
13
+ ),
14
+ (
15
+ "Check" ,
16
+ QtWidgets .QCheckBox (objectName = "check_box" ),
17
+ ),
18
+ ],
19
+ ),
20
+ ],
21
+ )
22
+ dialog .show ()
23
+
24
+ dialog .findChild (QtWidgets .QLineEdit , "line_edit" ).setText ("test" )
25
+ dialog .findChild (QtWidgets .QCheckBox , "check_box" ).setChecked (True )
26
+
27
+ assert utils .get_values (dialog ) == {
28
+ "line_edit" : "test" ,
29
+ "check_box" : True ,
30
+ }
31
+
32
+
33
+ def test_add_feature_collection_form (qgis_iface ):
34
+ dialog = forms .add_feature_collection_form (iface = qgis_iface )
35
+
36
+ dialog .findChild (QtWidgets .QLineEdit , "feature_collection_id" ).setText (
37
+ "USGS/WBD/2017/HUC06"
38
+ )
39
+
40
+ assert utils .get_values (dialog ) == {
41
+ "feature_collection_id" : "USGS/WBD/2017/HUC06" ,
42
+ "filter_name" : "" ,
43
+ "filter_value" : "" ,
44
+ # "start_date": "", # TODO: This is missing
45
+ # "end_date": "", # TODO: This is missing
46
+ "mYMaxLineEdit" : "" ,
47
+ "mYMinLineEdit" : "" ,
48
+ "mXMaxLineEdit" : "" ,
49
+ "mXMinLineEdit" : "" ,
50
+ "viz_color_hex" : "#000000" ,
51
+ "use_util" : False ,
52
+ ** { # TODO: this is unexpected
53
+ "mCondensedLineEdit" : "" ,
54
+ "qt_spinbox_lineedit" : "2025-02-12" ,
55
+ },
56
+ }
You can’t perform that action at this time.
0 commit comments