~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to general/g.list/testsuite/test_g_list.py

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""g.list tests"""
 
2
 
 
3
import grass.gunittest
 
4
from grass.gunittest.gmodules import SimpleModule
 
5
 
 
6
 
 
7
class GMlistWrongParamertersTest(grass.gunittest.TestCase):
 
8
    """Test wrong input of parameters for g.list module"""
 
9
 
 
10
    @classmethod
 
11
    def setUpClass(cls):
 
12
        """Create maps in a small region."""
 
13
        cls.use_temp_region()
 
14
        cls.runModule("g.region", s=0, n=5, w=0, e=5, res=1)
 
15
 
 
16
    @classmethod
 
17
    def tearDownClass(cls):
 
18
        """Remove temporary region"""
 
19
        cls.del_temp_region()
 
20
 
 
21
    def test_pt_flags(self):
 
22
        """Test that -p and -t flags are exclusive"""
 
23
        module = SimpleModule('g.list', flags='pt', type='raster')
 
24
        self.assertModuleFail(module)
 
25
        stderr = module.outputs.stderr
 
26
        self.assertIn('-p', stderr)
 
27
        self.assertIn('-t', stderr)
 
28
 
 
29
    def test_ft_flags(self):
 
30
        """Test that -f and -t flags are exclusive"""
 
31
        module = SimpleModule('g.list', flags='ft', type='raster')
 
32
        self.assertModuleFail(module)
 
33
        stderr = module.outputs.stderr
 
34
        self.assertIn('-f', stderr)
 
35
        self.assertIn('-t', stderr)
 
36
 
 
37
    def test_pf_flags(self):
 
38
        """Test that -p and -f flags are exclusive"""
 
39
        module = SimpleModule('g.list', flags='pf', type='raster')
 
40
        self.assertModuleFail(module)
 
41
        stderr = module.outputs.stderr
 
42
        self.assertIn('-p', stderr)
 
43
        self.assertIn('-f', stderr)
 
44
 
 
45
    def test_re_flags(self):
 
46
        """Test that -r and -e flags are exclusive"""
 
47
        module = SimpleModule('g.list', flags='re', type='raster')
 
48
        self.assertModuleFail(module)
 
49
        stderr = module.outputs.stderr
 
50
        self.assertIn('-r', stderr)
 
51
        self.assertIn('-e', stderr)
 
52
 
 
53
 
 
54
if __name__ == '__main__':
 
55
    grass.gunittest.test()