4
from grass.gunittest.gmodules import SimpleModule
7
class GMlistWrongParamertersTest(grass.gunittest.TestCase):
8
"""Test wrong input of parameters for g.list module"""
12
"""Create maps in a small region."""
14
cls.runModule("g.region", s=0, n=5, w=0, e=5, res=1)
17
def tearDownClass(cls):
18
"""Remove temporary region"""
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)
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)
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)
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)
54
if __name__ == '__main__':
55
grass.gunittest.test()