[GRASS-SVN] r64642 - grass/trunk/lib/python/docs/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 15 19:11:29 PST 2015
Author: wenzeslaus
Date: 2015-02-15 19:11:29 -0800 (Sun, 15 Feb 2015)
New Revision: 64642
Modified:
grass/trunk/lib/python/docs/src/gunittest_running_tests.rst
grass/trunk/lib/python/docs/src/gunittest_testing.rst
Log:
gunittest: briefly document how to write tests dealing with mapsets etc.
Modified: grass/trunk/lib/python/docs/src/gunittest_running_tests.rst
===================================================================
--- grass/trunk/lib/python/docs/src/gunittest_running_tests.rst 2015-02-16 02:42:06 UTC (rev 64641)
+++ grass/trunk/lib/python/docs/src/gunittest_running_tests.rst 2015-02-16 03:11:29 UTC (rev 64642)
@@ -6,6 +6,8 @@
go to :ref:`test-general`.
+.. _running-tests-report:
+
Running tests and creating report
---------------------------------
Modified: grass/trunk/lib/python/docs/src/gunittest_testing.rst
===================================================================
--- grass/trunk/lib/python/docs/src/gunittest_testing.rst 2015-02-16 02:42:06 UTC (rev 64641)
+++ grass/trunk/lib/python/docs/src/gunittest_testing.rst 2015-02-16 03:11:29 UTC (rev 64642)
@@ -9,6 +9,7 @@
* :ref:`test-python` section
* :ref:`test-doctest` section
* :class:`~gunittest.case.TestCase` class
+* :ref:`running-tests-report` section
Introduction
@@ -636,6 +637,26 @@
when running tests by the main test invoking tool.
+Tests creating separate Mapsets, Locations and GRASS Databases
+--------------------------------------------------------------
+
+If test is creating a custom Mapset or Mapsets, it can create them in
+the current Location or create a custom GRASS Database in the current
+directory. In any case, test has to take care of cleaning up (deleting)
+the created directories and it has to use names which will be unique
+enough (name of the test case class or the file is probably a good choice
+but completely unique identifier is probably much better).
+
+If test needs custom Location or it tests something related to GRASS Database,
+it must always create a new GRASS Database in the current directory.
+
+In any case, the author must try the tests cautiously and several times
+in the same Location to see if everything works as expected. Testing
+framework is using Mapsets to separate the tests and the functions
+does not explicitly check for the case where a test is using different
+Mapset then the one which has been given to it by the framework.
+
+
Analyzing quality of source code
--------------------------------
More information about the grass-commit
mailing list