[GRASS-SVN] r64676 - in grass/trunk/gui/wxpython/core: . testsuite testsuite/data

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 17 18:03:07 PST 2015


Author: wenzeslaus
Date: 2015-02-17 18:03:07 -0800 (Tue, 17 Feb 2015)
New Revision: 64676

Added:
   grass/trunk/gui/wxpython/core/testsuite/
   grass/trunk/gui/wxpython/core/testsuite/data/
   grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menu.xml
   grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menudata_ref.xml
   grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_user_toolboxes.xml
   grass/trunk/gui/wxpython/core/testsuite/toolboxes.sh
Removed:
   grass/trunk/gui/wxpython/core/test.toolboxes_menu.xml
   grass/trunk/gui/wxpython/core/test.toolboxes_menudata.xml
   grass/trunk/gui/wxpython/core/test.toolboxes_user_toolboxes.xml
Modified:
   grass/trunk/gui/wxpython/core/toolboxes.py
Log:
wxGUI/toolboxes: wrap toolboxes.py custom test as sh test

Deleted: grass/trunk/gui/wxpython/core/test.toolboxes_menu.xml
===================================================================
--- grass/trunk/gui/wxpython/core/test.toolboxes_menu.xml	2015-02-17 23:08:39 UTC (rev 64675)
+++ grass/trunk/gui/wxpython/core/test.toolboxes_menu.xml	2015-02-18 02:03:07 UTC (rev 64676)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<toolbox name="TestingMainMenu">
-  <label>Testing menu</label>
-  <items>
-    <subtoolbox name="Region"/>
-    <subtoolbox name="TestingToolboxA"/>
-    <subtoolbox name="MapProjections"/>
-    <subtoolbox name="TestingToolboxB"/>
-  </items>
-</toolbox>

Deleted: grass/trunk/gui/wxpython/core/test.toolboxes_menudata.xml
===================================================================
--- grass/trunk/gui/wxpython/core/test.toolboxes_menudata.xml	2015-02-17 23:08:39 UTC (rev 64675)
+++ grass/trunk/gui/wxpython/core/test.toolboxes_menudata.xml	2015-02-18 02:03:07 UTC (rev 64676)
@@ -1,85 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--This is an auto-generated file-->
-<menudata>
-  <menubar>
-    <menu>
-      <label>Region</label>
-      <items>
-        <menuitem>
-          <label>Display region</label>
-          <command>g.region -p</command>
-          <help>Manages the boundary definitions for the geographic region.</help>
-          <keywords>general,settings</keywords>
-          <handler>RunMenuCmd</handler>
-        </menuitem>
-        <menuitem>
-          <label>Set region</label>
-          <command>g.region</command>
-          <help>Manages the boundary definitions for the geographic region.</help>
-          <keywords>general,settings</keywords>
-          <handler>OnMenuCmd</handler>
-        </menuitem>
-      </items>
-    </menu>
-    <menu>
-      <label>&Testing toolbox A</label>
-      <items>
-        <menuitem>
-          <label>Set region</label>
-          <command>g.region</command>
-          <help>Manages the boundary definitions for the geographic region.</help>
-          <keywords>general,settings</keywords>
-          <handler>OnMenuCmd</handler>
-        </menuitem>
-        <separator />
-        <menuitem>
-          <label>Testing unknown module</label>
-          <command>m.unknown</command>
-          <help />
-          <keywords />
-          <handler>OnMenuCmd</handler>
-        </menuitem>
-        <subtoolbox name="QueryRasterMap" />
-      </items>
-    </menu>
-    <menu>
-      <label>Map projections</label>
-      <items>
-        <menuitem>
-          <label>Display map projection</label>
-          <command>g.proj -p</command>
-          <help>Converts co-ordinate system descriptions (i.e. projection information) between various formats (including GRASS format).</help>
-          <keywords>general,projection,create location</keywords>
-          <handler>RunMenuCmd</handler>
-        </menuitem>
-        <menuitem>
-          <label>Manage projections</label>
-          <command>g.proj</command>
-          <help>Prints and manipulates GRASS projection information files (in various co-ordinate system descriptions). Can also be used to create new GRASS locations.</help>
-          <keywords>general,projection,create location</keywords>
-          <handler>OnMenuCmd</handler>
-        </menuitem>
-        <separator />
-        <menuitem>
-          <label>Convert coordinates</label>
-          <command>m.proj</command>
-          <help>Converts coordinates from one projection to another (cs2cs frontend).</help>
-          <keywords>miscellaneous,projection</keywords>
-          <handler>OnMenuCmd</handler>
-        </menuitem>
-      </items>
-    </menu>
-    <menu>
-      <label>&Testing toolbox B</label>
-      <items>
-        <menuitem>
-          <label>Set region</label>
-          <command>g.region</command>
-          <help>Manages the boundary definitions for the geographic region.</help>
-          <keywords>general,settings</keywords>
-          <handler>OnMenuCmd</handler>
-        </menuitem>
-      </items>
-    </menu>
-  </menubar>
-</menudata>

Deleted: grass/trunk/gui/wxpython/core/test.toolboxes_user_toolboxes.xml
===================================================================
--- grass/trunk/gui/wxpython/core/test.toolboxes_user_toolboxes.xml	2015-02-17 23:08:39 UTC (rev 64675)
+++ grass/trunk/gui/wxpython/core/test.toolboxes_user_toolboxes.xml	2015-02-18 02:03:07 UTC (rev 64676)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<toolboxes>
-  <toolbox name="TestingToolboxA">
-    <label>&Testing toolbox A</label>
-    <items>
-      <module-item name="g.region">
-        <label>Set region</label>
-      </module-item>
-      <separator/>
-      <module-item name="m.unknown">
-        <label>Testing unknown module</label>
-      </module-item>
-      <subtoolbox name="QueryRasterMap"/>
-    </items>
-  </toolbox>
-  <toolbox name="TestingToolboxB">
-    <label>&Testing toolbox B</label>
-    <items>
-      <module-item name="g.region">
-        <label>Set region</label>
-      </module-item>
-    </items>
-  </toolbox>
-</toolboxes>
-

Copied: grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menu.xml (from rev 64675, grass/trunk/gui/wxpython/core/test.toolboxes_menu.xml)
===================================================================
--- grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menu.xml	                        (rev 0)
+++ grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menu.xml	2015-02-18 02:03:07 UTC (rev 64676)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<toolbox name="TestingMainMenu">
+  <label>Testing menu</label>
+  <items>
+    <subtoolbox name="Region"/>
+    <subtoolbox name="TestingToolboxA"/>
+    <subtoolbox name="MapProjections"/>
+    <subtoolbox name="TestingToolboxB"/>
+  </items>
+</toolbox>

Copied: grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menudata_ref.xml (from rev 64675, grass/trunk/gui/wxpython/core/test.toolboxes_menudata.xml)
===================================================================
--- grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menudata_ref.xml	                        (rev 0)
+++ grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_menudata_ref.xml	2015-02-18 02:03:07 UTC (rev 64676)
@@ -0,0 +1,85 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--This is an auto-generated file-->
+<menudata>
+  <menubar>
+    <menu>
+      <label>Region</label>
+      <items>
+        <menuitem>
+          <label>Display region</label>
+          <command>g.region -p</command>
+          <help>Manages the boundary definitions for the geographic region.</help>
+          <keywords>general,settings</keywords>
+          <handler>RunMenuCmd</handler>
+        </menuitem>
+        <menuitem>
+          <label>Set region</label>
+          <command>g.region</command>
+          <help>Manages the boundary definitions for the geographic region.</help>
+          <keywords>general,settings</keywords>
+          <handler>OnMenuCmd</handler>
+        </menuitem>
+      </items>
+    </menu>
+    <menu>
+      <label>&Testing toolbox A</label>
+      <items>
+        <menuitem>
+          <label>Set region</label>
+          <command>g.region</command>
+          <help>Manages the boundary definitions for the geographic region.</help>
+          <keywords>general,settings</keywords>
+          <handler>OnMenuCmd</handler>
+        </menuitem>
+        <separator />
+        <menuitem>
+          <label>Testing unknown module</label>
+          <command>m.unknown</command>
+          <help />
+          <keywords />
+          <handler>OnMenuCmd</handler>
+        </menuitem>
+        <subtoolbox name="QueryRasterMap" />
+      </items>
+    </menu>
+    <menu>
+      <label>Map projections</label>
+      <items>
+        <menuitem>
+          <label>Display map projection</label>
+          <command>g.proj -p</command>
+          <help>Converts co-ordinate system descriptions (i.e. projection information) between various formats (including GRASS format).</help>
+          <keywords>general,projection,create location</keywords>
+          <handler>RunMenuCmd</handler>
+        </menuitem>
+        <menuitem>
+          <label>Manage projections</label>
+          <command>g.proj</command>
+          <help>Prints or modifies GRASS projection information files (in various co-ordinate system descriptions). Can also be used to create new GRASS locations.</help>
+          <keywords>general,projection,create location</keywords>
+          <handler>OnMenuCmd</handler>
+        </menuitem>
+        <separator />
+        <menuitem>
+          <label>Convert coordinates</label>
+          <command>m.proj</command>
+          <help>Converts coordinates from one projection to another (cs2cs frontend).</help>
+          <keywords>miscellaneous,projection</keywords>
+          <handler>OnMenuCmd</handler>
+        </menuitem>
+      </items>
+    </menu>
+    <menu>
+      <label>&Testing toolbox B</label>
+      <items>
+        <menuitem>
+          <label>Set region</label>
+          <command>g.region</command>
+          <help>Manages the boundary definitions for the geographic region.</help>
+          <keywords>general,settings</keywords>
+          <handler>OnMenuCmd</handler>
+        </menuitem>
+      </items>
+    </menu>
+  </menubar>
+</menudata>

Copied: grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_user_toolboxes.xml (from rev 64675, grass/trunk/gui/wxpython/core/test.toolboxes_user_toolboxes.xml)
===================================================================
--- grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_user_toolboxes.xml	                        (rev 0)
+++ grass/trunk/gui/wxpython/core/testsuite/data/test_toolboxes_user_toolboxes.xml	2015-02-18 02:03:07 UTC (rev 64676)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<toolboxes>
+  <toolbox name="TestingToolboxA">
+    <label>&Testing toolbox A</label>
+    <items>
+      <module-item name="g.region">
+        <label>Set region</label>
+      </module-item>
+      <separator/>
+      <module-item name="m.unknown">
+        <label>Testing unknown module</label>
+      </module-item>
+      <subtoolbox name="QueryRasterMap"/>
+    </items>
+  </toolbox>
+  <toolbox name="TestingToolboxB">
+    <label>&Testing toolbox B</label>
+    <items>
+      <module-item name="g.region">
+        <label>Set region</label>
+      </module-item>
+    </items>
+  </toolbox>
+</toolboxes>
+

Added: grass/trunk/gui/wxpython/core/testsuite/toolboxes.sh
===================================================================
--- grass/trunk/gui/wxpython/core/testsuite/toolboxes.sh	                        (rev 0)
+++ grass/trunk/gui/wxpython/core/testsuite/toolboxes.sh	2015-02-18 02:03:07 UTC (rev 64676)
@@ -0,0 +1,7 @@
+# Tests generating toolboxes XML
+
+# run make in gui/wxpython before the test
+# run test using sh -e
+
+python $GISBASE/gui/wxpython/core/toolboxes.py doctest
+python $GISBASE/gui/wxpython/core/toolboxes.py test

Modified: grass/trunk/gui/wxpython/core/toolboxes.py
===================================================================
--- grass/trunk/gui/wxpython/core/toolboxes.py	2015-02-17 23:08:39 UTC (rev 64675)
+++ grass/trunk/gui/wxpython/core/toolboxes.py	2015-02-18 02:03:07 UTC (rev 64676)
@@ -706,8 +706,8 @@
     directory and in files from distribution.
     """
     toolboxesFile   = os.path.join(WXGUIDIR, 'xml', 'toolboxes.xml')
-    userToolboxesFile = 'test.toolboxes_user_toolboxes.xml'
-    menuFile = 'test.toolboxes_menu.xml'
+    userToolboxesFile = 'data/test_toolboxes_user_toolboxes.xml'
+    menuFile = 'data/test_toolboxes_menu.xml'
     wxguiItemsFile  = os.path.join(WXGUIDIR, 'xml', 'wxgui_items.xml')
     moduleItemsFile = os.path.join(WXGUIDIR, 'xml', 'module_items.xml')
 
@@ -734,7 +734,7 @@
         sys.stdout.write(_getXMLString(root))
         return 0
 
-    menudataFile = 'test.toolboxes_menudata.xml'
+    menudataFile = 'data/test_toolboxes_menudata_ref.xml'
     with open(menudataFile) as correctMenudata:
         correct = str(correctMenudata.read())
 



More information about the grass-commit mailing list