[GRASS-SVN] r61991 - in grass/trunk/lib/python/pygrass: . gis gis/testsuite messages messages/testsuite modules modules/grid modules/grid/testsuite modules/interface/testsuite modules/testsuite raster raster/testsuite raster/testsuite/data shell shell/testsuite testsuite vector/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 16 01:27:00 PDT 2014


Author: lucadelu
Date: 2014-09-16 01:27:00 -0700 (Tue, 16 Sep 2014)
New Revision: 61991

Added:
   grass/trunk/lib/python/pygrass/gis/testsuite/
   grass/trunk/lib/python/pygrass/gis/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/gis/testsuite/test_gis.py
   grass/trunk/lib/python/pygrass/messages/testsuite/
   grass/trunk/lib/python/pygrass/messages/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/modules/grid/testsuite/
   grass/trunk/lib/python/pygrass/modules/grid/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/modules/interface/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/modules/testsuite/
   grass/trunk/lib/python/pygrass/modules/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/raster/testsuite/
   grass/trunk/lib/python/pygrass/raster/testsuite/data/
   grass/trunk/lib/python/pygrass/raster/testsuite/data/geology_cats
   grass/trunk/lib/python/pygrass/raster/testsuite/test_category.py
   grass/trunk/lib/python/pygrass/raster/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/raster/testsuite/test_history.py
   grass/trunk/lib/python/pygrass/raster/testsuite/test_raster.py
   grass/trunk/lib/python/pygrass/shell/testsuite/
   grass/trunk/lib/python/pygrass/shell/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/testsuite/
   grass/trunk/lib/python/pygrass/testsuite/test_doctests.py
   grass/trunk/lib/python/pygrass/vector/testsuite/test_doctests.py
Log:
pygrass: add new tests, specially doctests

Added: grass/trunk/lib/python/pygrass/gis/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/gis/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.gis as pgrass
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(pgrass))
+    tests.addTests(doctest.DocTestSuite(pgrass.region))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/gis/testsuite/test_gis.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/testsuite/test_gis.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/gis/testsuite/test_gis.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+"""
+Luca Delucchi
+"""
+
+from grass.gunittest import TestCase, test
+
+from grass.pygrass.gis.region import Region
+
+
+class RegionTestCate(TestCase):
+
+    def test_bounds(self):
+        reg1 = Region()
+        reg2 = Region()
+        self.assertTrue(reg1, reg2)
+        north = reg2.north
+        reg2.north = 0
+        self.assertNotEqual(reg1.north, reg2.north)
+        reg2.north = north
+
+
+if __name__ == '__main__':
+    test()

Added: grass/trunk/lib/python/pygrass/messages/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/messages/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/messages/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.messages as gmessages
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(gmessages))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/modules/grid/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/grid/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/modules/grid/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.modules as gmodules
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+
+    tests.addTests(doctest.DocTestSuite(gmodules.shortcuts))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/modules/interface/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/modules/interface/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.modules as gmodules
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(gmodules.interface.flag))
+    tests.addTests(doctest.DocTestSuite(gmodules.interface.module))
+    tests.addTests(doctest.DocTestSuite(gmodules.interface.parameter))
+
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/modules/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/modules/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.modules as gmodules
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(gmodules.interface))
+    tests.addTests(doctest.DocTestSuite(gmodules.grid.grid))
+    tests.addTests(doctest.DocTestSuite(gmodules.grid.patch))
+    tests.addTests(doctest.DocTestSuite(gmodules.grid.split))
+    tests.addTests(doctest.DocTestSuite(gmodules.shortcuts))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/raster/testsuite/data/geology_cats
===================================================================
--- grass/trunk/lib/python/pygrass/raster/testsuite/data/geology_cats	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/raster/testsuite/data/geology_cats	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,1832 @@
+Zml:1
+Zmf:2
+Zml:3
+Zml:4
+Ybgg:5
+Zml:6
+Ybgg:7
+Zmf:8
+Zml:9
+Zml:10
+Qp:11
+Zatm:12
+Qp:13
+Qp:14
+Zata:15
+Zmf:16
+Zata:17
+Qp:18
+Qp:19
+Ccl:20
+Qp:21
+Qp:22
+Zata:23
+Ccl:24
+Qp:25
+Zabg:26
+Qp:27
+Tpy:28
+Zabs:29
+Qp:30
+Ybgg:31
+CZam:32
+Qp:33
+Zabs:34
+Qp:35
+CZbb:36
+Qp:37
+OCg:38
+PzZq:39
+Tt:40
+Tt:41
+CZig:42
+Tt:43
+CZig:44
+CZms:45
+CZig:46
+OCg:47
+CZig:48
+PPmg:49
+CZms:50
+PPg:51
+OCg:52
+CZma1:53
+CZbg:54
+CZam:55
+Qp:56
+CZms:57
+Zata:58
+CZph:59
+CZg:60
+CZmg:61
+PPg:62
+CZve:63
+TRds:64
+CZv:65
+PzZg:66
+TRdc:67
+CZbg:68
+CZfv:69
+TRdp:70
+Sg:71
+CZve:72
+CZfg:73
+CZfg:74
+CZfg:75
+CZfv:76
+CZv:77
+OCg:78
+PzZg:79
+CZam:80
+CZfg:81
+CZmd:82
+Dqd:83
+PzZg:84
+CZam:85
+CZfg:86
+Qp:87
+PzZu:88
+Zg:89
+OCg:90
+Qp:91
+Qp:92
+Zats:93
+Tt:94
+PzZg:95
+Qp:96
+CZbg:97
+CZfg:98
+Qp:99
+TRdc:100
+CZfv:101
+Qp:102
+Qp:103
+Qp:104
+Qp:105
+Qp:106
+PzZu:107
+PzZu:108
+Zg:109
+TRdc:110
+CZfg:111
+CZfg:112
+Qp:113
+Qp:114
+Qp:115
+Zg:116
+Tt:117
+Tt:118
+PzZu:119
+Qp:120
+CZms:121
+PzZu:122
+Qp:123
+CZbg:124
+Qp:125
+Zabs:126
+Qp:127
+Qp:128
+Tt:129
+Zats:130
+Tt:131
+Zatm:132
+Zatm:133
+PzZq:134
+CZg:135
+CZfv:136
+CZiv:137
+Zabs:138
+Zatm:139
+PzZg:140
+Tt:141
+CZg:142
+Tt:143
+Qp:144
+Qp:145
+Zaba:146
+PzZg:147
+PPmg:148
+PzZu:149
+PzZq:150
+Qp:151
+Tt:152
+CZfg:153
+CZmd:154
+Zabs:155
+Qp:156
+Tt:157
+PzZg:158
+PPmg:159
+Tt:160
+CZq:161
+Zatm:162
+Qp:163
+TRdc:164
+Tt:165
+Zabs:166
+PzZu:167
+PzZq:168
+PzZg:169
+CZph:170
+Zg:171
+TRdc:172
+Qp:173
+TRdc:174
+PPg:175
+PzZu:176
+Tt:177
+Yg:178
+Zg:179
+Qp:180
+Dqd:181
+Tt:182
+Zg:183
+CZg:184
+CZms:185
+CZma1:186
+Zatm:187
+Zatm:188
+Tt:189
+TRdp:190
+Zatm:191
+CZfv:192
+Zatm:193
+Ccl:194
+CZbg:195
+PzZq:196
+CZfv:197
+Tpy:198
+Ygg:199
+PzZg:200
+Qp:201
+Ybgg:202
+Tt:203
+Qp:204
+Tt:205
+Zatm:206
+PzZu:207
+Zg:208
+Qp:209
+Qp:210
+PzZu:211
+CZam:212
+Qp:213
+CZq:214
+PPmg:215
+Kc:216
+CZfg:217
+Kc:218
+CZam:219
+Qp:220
+Tt:221
+PzZu:222
+Qp:223
+Qp:224
+PzZg:225
+Qp:226
+Qp:227
+Zg:228
+PzZu:229
+Qp:230
+Zatm:231
+PPg:232
+PzZq:233
+Yg:234
+CZg:235
+Qp:236
+Qp:237
+Qp:238
+PzZg:239
+Zatm:240
+PzZg:241
+PzZg:242
+CZmv:243
+Qp:244
+PzZq:245
+PzZq:246
+CZfg:247
+Qp:248
+Qp:249
+CZfv:250
+CZg:251
+Tt:252
+Qp:253
+Qp:254
+CZmd:255
+Qp:256
+Qp:257
+CZfg:258
+Tpy:259
+Qp:260
+Zg:261
+CZlg:262
+CZfv:263
+Dqd:264
+Qp:265
+Qp:266
+PzZg:267
+Tt:268
+Qp:269
+CZig:270
+Ccl:271
+Kc:272
+Tt:273
+Qp:274
+Qp:275
+Qp:276
+PzZg:277
+Ybgg:278
+Qp:279
+PzZg:280
+Zg:281
+CZma:282
+PzZg:283
+Qp:284
+Qp:285
+Tt:286
+CZbg:287
+Zbg:288
+PzZq:289
+CZg:290
+CZma1:291
+Qp:292
+Tt:293
+Qp:294
+CZma1:295
+Qp:296
+Tt:297
+Qp:298
+CZms:299
+Qp:300
+Qp:301
+Tt:302
+PzZg:303
+CZbf:304
+CZbg:305
+TRc:306
+Zg:307
+PzZg:308
+CZma2:309
+Qp:310
+Yg:311
+CZam:312
+CZms:313
+Tt:314
+Zg:315
+CZms:316
+Qp:317
+CZve:318
+Qp:319
+PPg:320
+Yg:321
+PPg:322
+Qp:323
+PzZg:324
+Qp:325
+PPg:326
+Qp:327
+CZms:328
+Tt:329
+PzZg:330
+Tt:331
+Tt:332
+Tt:333
+OCg:334
+CZbg:335
+Jd:336
+Tt:337
+CZph:338
+CZmg:339
+TRc:340
+PzZq:341
+CZfv:342
+CZmv:343
+Tt:344
+CZiv:345
+Zgma:346
+Zgms:347
+Zgmf:348
+Zgmg:349
+CZiv:350
+CZfv:351
+CZfv:352
+Zgmw:353
+Tt:354
+PzZq:355
+Zgms:356
+PzZu:357
+CZiv:358
+Tt:359
+PzZu:360
+PPg:361
+PzZg:362
+Ybrg:363
+PzZg:364
+CZiv:365
+Zgmu:366
+Zgmg:367
+CZms:368
+CZmg:369
+CZam:370
+Jd:371
+Ygg:372
+Zgma:373
+CZms:374
+CZfv:375
+CZfv:376
+PzZu:377
+Ymg:378
+CZve:379
+CZq:380
+Tt:381
+PzZg:382
+PzZu:383
+CZq:384
+Jd:385
+Zgmu:386
+CZam:387
+Zgmf:388
+Zgmg:389
+PPg:390
+Zlm:391
+CZmv:392
+CZms:393
+CZmg:394
+OCgm:395
+Ccl:396
+PPmg:397
+Ybgg:398
+CZq:399
+CZiv:400
+Tt:401
+Zgmg:402
+CZms:403
+Ybgg:404
+CZbg:405
+Zlm:406
+Jd:407
+PzZg:408
+Zlm:409
+CZms:410
+PzZu:411
+Ybrg:412
+CZms:413
+Ccl:414
+CZq:415
+Zlm:416
+Zlm:417
+Ccl:418
+CZmd:419
+CZms:420
+Zlm:421
+CZms:422
+PzZg:423
+Zlm:424
+Jd:425
+Tt:426
+CZiv:427
+CZms:428
+PzZg:429
+Ccu:430
+Zlm:431
+CZam:432
+Tt:433
+CZmv:434
+PzZg:435
+Zgmu:436
+PzZu:437
+Zlm:438
+Zs:439
+Zlm:440
+Zlm:441
+Zlm:442
+CZg:443
+Zgmg:444
+Tt:445
+Zlm:446
+Zgmu:447
+CZiv:448
+PzZg:449
+PzZm:450
+Ccl:451
+Ygg:452
+Tt:453
+Tt:454
+CZfv:455
+Tt:456
+CZiv:457
+Zata:458
+Zgmg:459
+CZbg:460
+CZmd:461
+CZms:462
+CZg:463
+CZam:464
+TRd:465
+Zatm:466
+CZiv:467
+CZmv:468
+Tt:469
+Zlm:470
+PzZu:471
+Zwc:472
+Ybgg:473
+Zlm:474
+PzZu:475
+PzZu:476
+PzZg:477
+Qp:478
+Jd:479
+CZph:480
+Zlm:481
+Tt:482
+Qp:483
+Qp:484
+PzZu:485
+Ygg:486
+Qp:487
+CZph:488
+PzZm:489
+Zg:490
+Zgmg:491
+CZfv:492
+Qp:493
+CZiv:494
+Tt:495
+CZmv:496
+CZiv:497
+CZms:498
+Qp:499
+Jd:500
+Qp:501
+Jd:502
+CZiv:503
+CZph:504
+Zss:505
+PzZg:506
+Zg:507
+Jd:508
+PzZg:509
+CZmv:510
+CZfv:511
+Jd:512
+Zata:513
+Zata:514
+CZg:515
+CZg:516
+OCg:517
+CZph:518
+PzZg:519
+Dqd:520
+Ccl:521
+Zata:522
+DOgb:523
+Tt:524
+CZph:525
+PzZu:526
+CZiv:527
+Zlm:528
+Ccu:529
+Zata:530
+Zata:531
+Chg:532
+Chg:533
+Zlm:534
+CZmd:535
+Zgmu:536
+Qp:537
+CZba:538
+CZpg:539
+OCg:540
+PzZg:541
+PzZm:542
+Zsp:543
+Tt:544
+Dqd:545
+CZms:546
+Dqd:547
+CZab:548
+CZms:549
+CZms:550
+CZg:551
+CZq:552
+OCg:553
+Qp:554
+PzZu:555
+Zss:556
+CZfv:557
+CZab:558
+Zlm:559
+Zata:560
+Zs:561
+Zsr:562
+CZg:563
+CZms:564
+Tt:565
+PPg:566
+CZfv:567
+PzZg:568
+Zaba:569
+CZiv:570
+PzZu:571
+CZbg:572
+CZiv:573
+PzZu:574
+CZg:575
+Zata:576
+PzZg:577
+Dqd:578
+CZve:579
+CZve:580
+Ccl:581
+Dqd:582
+CZve:583
+CZbg:584
+Dqd:585
+Zata:586
+Dqd:587
+Dqd:588
+Zss:589
+CZg:590
+Tt:591
+Zgmf:592
+Tt:593
+Qp:594
+Zsl:595
+Dqd:596
+PzZg:597
+PzZu:598
+PzZg:599
+CZab:600
+Dqd:601
+CZiv:602
+CZg:603
+Zm:604
+Qp:605
+CZg:606
+Zg:607
+DOgb:608
+Zaba:609
+Zgmu:610
+Cr:611
+Jd:612
+Zaba:613
+Cs:614
+PPmg:615
+Zg:616
+CZms:617
+CZg:618
+Kc:619
+CZfv:620
+Cs:621
+Tpy:622
+PzZu:623
+CZiv:624
+CZmd:625
+CZms:626
+PzZu:627
+CZg:628
+OCg:629
+Chg:630
+Ccu:631
+Zgmg:632
+PzZu:633
+CZms:634
+CZg:635
+bz:636
+CZg:637
+PzZu:638
+Tt:639
+PzZu:640
+CZg:641
+CZg:642
+CZms:643
+Dqd:644
+Ybrg:645
+Ccl:646
+Qp:647
+Dqd:648
+PzZu:649
+CZms:650
+CZfv1:651
+PzZu:652
+CZg:653
+Tt:654
+PPmg:655
+Zss:656
+Tt:657
+PzZg:658
+Qp:659
+Tt:660
+Zs:661
+Qp:662
+Qp:663
+Zm:664
+PzZu:665
+Qp:666
+Tt:667
+Qp:668
+Zatw:669
+OCg:670
+Tt:671
+CZg:672
+Zsw:673
+Dqd:674
+CZq:675
+Ccl:676
+CZmv:677
+PzZu:678
+Zabg:679
+CZbg:680
+Qp:681
+Zm:682
+CZab:683
+OCg:684
+Dqd:685
+PzZu:686
+Chg:687
+CZv:688
+Zabg:689
+Tt:690
+PzZu:691
+Zgmf:692
+CZv:693
+Chg:694
+PzZu:695
+CZbg:696
+Ybam:697
+Zabg:698
+CZfv:699
+Ccl:700
+Dqd:701
+Dqd:702
+CZiv:703
+PzZu:704
+Tt:705
+Ymg:706
+Ybam:707
+CZfv:708
+OCg:709
+Tt:710
+OCg:711
+PzZu:712
+Ybam:713
+OCg:714
+CZv:715
+CZfv:716
+Chg:717
+Chg:718
+Tt:719
+CZam:720
+Qp:721
+Ymam:722
+CZg:723
+Qp:724
+CZmv:725
+Ccu:726
+Tt:727
+Tt:728
+Qp:729
+CZfv:730
+Qp:731
+Ybam:732
+CZms:733
+CZmd:734
+Qp:735
+Tt:736
+Qp:737
+Tt:738
+Qp:739
+PzZq:740
+PzZu:741
+CZiv:742
+Qp:743
+CZiv:744
+CZg:745
+Qp:746
+PzZu:747
+Zsw:748
+PzZq:749
+Tt:750
+Zsr:751
+Zsl:752
+Zsp:753
+Qp:754
+Chg:755
+Qp:756
+Qp:757
+Ccu:758
+Qp:759
+Qp:760
+PPg:761
+OCg:762
+Tt:763
+Zsw:764
+CZg:765
+CZg:766
+Ymam:767
+Qp:768
+Chg:769
+CZmd2:770
+PzZq:771
+CZmd:772
+CZg:773
+Ybam:774
+CZms:775
+Zm:776
+Zrb:777
+CZmd:778
+CZmd:779
+PzZu:780
+Zch:781
+CZbg:782
+Qp:783
+CZph:784
+Cs:785
+PzZu:786
+CZmd:787
+CZms:788
+CZmd:789
+CZiv:790
+OCg:791
+Ymam:792
+OCg:793
+CZba:794
+Ccu:795
+DSg:796
+CZph:797
+Ymam:798
+CZmd1:799
+Ybgg:800
+CZfv:801
+Tt:802
+CZiv:803
+OCg:804
+CZg:805
+CZfv:806
+PzZg:807
+CZbg:808
+CZiv:809
+Ymam:810
+CZms:811
+CZiv:812
+CZmd:813
+CZfv:814
+Ybgg:815
+PzZm:816
+PPg:817
+CZmv1:818
+CZbg:819
+CZc:820
+CZmd:821
+Chg:822
+DSg:823
+Tt:824
+CZbf:825
+CZg:826
+CZiv:827
+CZg:828
+Tt:829
+CZfv:830
+Tt:831
+CZmv:832
+CZve:833
+ZYbn:834
+CZfv:835
+CZve:836
+Zchs:837
+PzZg:838
+Zbt:839
+CZfv2:840
+Tt:841
+PPg:842
+OCg:843
+CZbf:844
+PPg:845
+PPg:846
+CZab:847
+Ymam:848
+CZfv:849
+OCg:850
+CZab:851
+Zgs:852
+Tt:853
+CZmv:854
+CZms:855
+CZba:856
+CZfv:857
+PzZg:858
+CZfv:859
+CZmd:860
+PPmg:861
+CZam:862
+Tt:863
+PzZu:864
+Zbt:865
+CZc:866
+Ymam:867
+CZba:868
+Tt:869
+CZve:870
+CZmd:871
+PzZu:872
+Zsw:873
+CZbg:874
+PPg:875
+Za:876
+CZms:877
+Ymam:878
+Tt:879
+OCg:880
+CZiv:881
+CZbg:882
+PzZu:883
+CZpg:884
+CZbg:885
+Qp:886
+PPg:887
+CZve:888
+CZmd:889
+Kb:890
+PzZu:891
+CZbg:892
+Tt:893
+Zsr:894
+OCg:895
+OCg:896
+CZmd3:897
+OCg:898
+PPmg:899
+Tt:900
+Tt:901
+Qp:902
+Zsr:903
+Ybgg:904
+DOgb:905
+PPmg:906
+OCg:907
+Qp:908
+Tt:909
+CZbg:910
+PPg:911
+PzZu:912
+Zsw:913
+Tt:914
+PzZu:915
+CZmd:916
+Zsl:917
+Qp:918
+DSg:919
+CZab:920
+Km:921
+Qp:922
+Tt:923
+PzZg:924
+CZmd:925
+CZmv:926
+CZmv:927
+Zsl:928
+Zchs:929
+CZiv:930
+Tt:931
+CZfv:932
+Ymam:933
+PzZu:934
+PzZu:935
+CZms:936
+CZq:937
+PzZu:938
+CZbg:939
+PzZg:940
+Tt:941
+CZfv:942
+CZq:943
+CZbg:944
+CZbg:945
+CZam:946
+Tt:947
+CZam:948
+CZve:949
+Zchs:950
+CZiv:951
+PPmg:952
+PPmg:953
+OCg:954
+CZfv:955
+Tt:956
+Tec:957
+CZg:958
+CZfg:959
+Tt:960
+DSg:961
+Zs:962
+Tt:963
+CZbl:964
+CZg:965
+TRc:966
+DSg:967
+PzZm:968
+CZph:969
+TRcp:970
+PPmg:971
+CZbg:972
+CZve:973
+CZmv:974
+Zchs:975
+PzZu:976
+TRcp:977
+Tt:978
+Tt:979
+OCg:980
+Km:981
+Za:982
+Zgs:983
+Km:984
+PzZu:985
+PzZu:986
+CZg:987
+Zsl:988
+Tt:989
+CZbg:990
+CZfv:991
+CZmv:992
+CZve:993
+Kp:994
+Tt:995
+Zchs:996
+CZph:997
+Tpy:998
+CZve:999
+CZfv:1000
+PzZu:1001
+Tt:1002
+CZbg:1003
+CZve:1004
+PzZg:1005
+CZve:1006
+PzZu:1007
+TRcc:1008
+TRcs:1009
+PzZu:1010
+Zbt:1011
+CZfv:1012
+Tt:1013
+DOg:1014
+DSg:1015
+CZbg:1016
+Chg:1017
+Tt:1018
+PzZu:1019
+PzZg:1020
+Zs:1021
+CZmd:1022
+CZq:1023
+CZmd:1024
+PzZu:1025
+PzZg:1026
+Zgs:1027
+Kc:1028
+CZve:1029
+Zs:1030
+Tt:1031
+OCg:1032
+CZve:1033
+Qp:1034
+CZbg:1035
+TRcc:1036
+CZms:1037
+CZpg:1038
+PPg:1039
+CZfv:1040
+TRcp:1041
+PzZu:1042
+Tpy:1043
+CZg:1044
+CZmd:1045
+CZam:1046
+SOgg:1047
+PzZm:1048
+CZms:1049
+CZph:1050
+CZbg:1051
+CZms:1052
+ZYbn:1053
+OCg:1054
+Chg:1055
+Zatm:1056
+Tt:1057
+PzZu:1058
+TRcs:1059
+CZbg:1060
+CZam:1061
+CZmd:1062
+Tt:1063
+OCg:1064
+CZve:1065
+CZph:1066
+CZmd:1067
+PPmg:1068
+CZab:1069
+CZg:1070
+TRcc:1071
+CZbg:1072
+CZfv:1073
+CZbg:1074
+PzZg:1075
+Zwe:1076
+CZbg:1077
+CZve:1078
+TRcs:1079
+Ybgg:1080
+DOg:1081
+CZv:1082
+Zbg:1083
+CZmv1:1084
+CZfv:1085
+Chg:1086
+CZbg:1087
+PPmg:1088
+ZYbn:1089
+CZms:1090
+Tt:1091
+CZbg:1092
+Kb:1093
+Tt:1094
+CZph:1095
+CZfg:1096
+CZbg:1097
+DSg:1098
+CZmd3:1099
+PzZm:1100
+CZtp:1101
+Ybgg:1102
+CZms:1103
+CZms:1104
+Mc:1105
+Tpy:1106
+DSg:1107
+PzZm:1108
+CZab:1109
+Tt:1110
+CZph:1111
+DOg:1112
+TRcc:1113
+Jd:1114
+PzZm:1115
+Kp:1116
+Kp:1117
+Kp:1118
+CZbg:1119
+Qp:1120
+DSg:1121
+CZbg:1122
+Zwe:1123
+OCg:1124
+CZmd:1125
+Tt:1126
+CZab:1127
+CZph:1128
+CZmd:1129
+CZmd:1130
+CZmd:1131
+CZv:1132
+Jd:1133
+CZy:1134
+Km:1135
+TRcc:1136
+DOgb:1137
+CZbg:1138
+Zhha:1139
+CZmv:1140
+PzZu:1141
+CZbg:1142
+CZph:1143
+CZms:1144
+Zchs:1145
+Kc:1146
+CZbg:1147
+CZbg:1148
+Chg:1149
+PzZu:1150
+Zd:1151
+CZiv:1152
+PzZu:1153
+Kc:1154
+Znt:1155
+Tt:1156
+DOgb:1157
+CZgms:1158
+CZfv:1159
+Ybgg:1160
+CZab:1161
+CZfv:1162
+CZfv:1163
+CZfv:1164
+Dsc:1165
+TRcc:1166
+Tt:1167
+CZfv:1168
+CZmd:1169
+Dqd:1170
+Tt:1171
+CZmd2:1172
+CZph:1173
+Znt:1174
+TRcp:1175
+TRcc:1176
+CZph:1177
+Qp:1178
+CZms:1179
+CZq:1180
+TRcc:1181
+Jd:1182
+CZfv:1183
+CZms:1184
+Zb:1185
+CZfv:1186
+Jd:1187
+PzZu:1188
+Tpy:1189
+OCg:1190
+CZiv:1191
+OCg:1192
+DOg:1193
+Qp:1194
+DSg:1195
+CZq:1196
+Tt:1197
+PzZu:1198
+TRcs:1199
+CZv:1200
+DOgb:1201
+CZph:1202
+DOgb:1203
+DOgb:1204
+PzZu:1205
+DSs:1206
+Zatb:1207
+Km:1208
+CZfv:1209
+Zd:1210
+Tec:1211
+PPmg:1212
+CZph:1213
+CZbg:1214
+DOgb:1215
+CZfv:1216
+CZbg:1217
+CZam:1218
+CZtp:1219
+CZbg:1220
+CZms:1221
+CZg:1222
+CZph:1223
+Kc:1224
+Zman:1225
+Zchs:1226
+CZv:1227
+Qp:1228
+CZms:1229
+CZpg:1230
+Qp:1231
+CZmv:1232
+Zchs:1233
+CZfv:1234
+CZab:1235
+CZph:1236
+CZmd:1237
+CZtp:1238
+CZbg:1239
+Zmb:1240
+CZfv:1241
+Tpa:1242
+Qp:1243
+PzZm:1244
+Dqd:1245
+Zbg:1246
+CZab:1247
+Dqd:1248
+Qp:1249
+Qp:1250
+PzZu:1251
+Dqd:1252
+CZfv:1253
+TRcc:1254
+CZph:1255
+Qp:1256
+CZph:1257
+PPg:1258
+Qp:1259
+CZbg:1260
+TRcs:1261
+CZve:1262
+Zch:1263
+Zchs:1264
+Zf:1265
+Kb:1266
+PzZm:1267
+TRcs:1268
+Tt:1269
+Tpy:1270
+Km:1271
+CZms:1272
+TRcc:1273
+CZv:1274
+OCg:1275
+Mc:1276
+Dqd:1277
+Mc:1278
+Qp:1279
+Dqd:1280
+PzZm:1281
+SOgg:1282
+CZgms:1283
+DSs:1284
+PzZq:1285
+Tpa:1286
+Kc:1287
+Tpy:1288
+SOgg:1289
+Zwe:1290
+CZq:1291
+DSg:1292
+CZms:1293
+Zch:1294
+CZv:1295
+OCg:1296
+CZms:1297
+DOgb:1298
+OCg:1299
+Qp:1300
+Dqd:1301
+CZms:1302
+TRcs:1303
+Qp:1304
+CZq:1305
+DOgb:1306
+Tecs:1307
+CZbg:1308
+Tp:1309
+CZms:1310
+Tec:1311
+CZbg:1312
+Dsc:1313
+DOg:1314
+CZgms:1315
+CZms:1316
+Tp:1317
+CZbg:1318
+CZve:1319
+CZbg:1320
+DOg:1321
+TRcs:1322
+Tt:1323
+CZpg:1324
+Tpa:1325
+Zata:1326
+CZpg:1327
+OCg:1328
+Dqd:1329
+CZpg:1330
+CZms:1331
+CZmd:1332
+CZms:1333
+Tt:1334
+Dqd:1335
+PzZq:1336
+Dqd:1337
+CZiv:1338
+PzZm:1339
+Tec:1340
+TRc:1341
+Dsc:1342
+CZgms:1343
+Zch:1344
+CZph:1345
+ZYba:1346
+Dqd:1347
+ZYba:1348
+CZph:1349
+PzZu:1350
+Tp:1351
+PzZu:1352
+Dqd:1353
+ZYba:1354
+OCg:1355
+ZYba:1356
+TRc:1357
+PzZu:1358
+ZYba:1359
+OCg:1360
+ZYba:1361
+PzZu:1362
+Tec:1363
+Km:1364
+OCg:1365
+Tpa:1366
+ZYba:1367
+CZms:1368
+Dqd:1369
+Tec:1370
+CZph:1371
+Dqd:1372
+ZYba:1373
+CZiv:1374
+CZg:1375
+ZYba:1376
+Tpy:1377
+CZms:1378
+PzZu:1379
+ZYba:1380
+Km:1381
+CZgms:1382
+ZYba:1383
+CZms:1384
+Dqd:1385
+ZYba:1386
+CZms:1387
+CZtp:1388
+CZmd:1389
+TRcs:1390
+Km:1391
+Zata:1392
+Qp:1393
+DOg:1394
+Dsc:1395
+Qp:1396
+CZbg:1397
+Ytg:1398
+Dsc:1399
+CZtp:1400
+Zb:1401
+ZYba:1402
+ZYba:1403
+Km:1404
+Tpy:1405
+Zata:1406
+CZph:1407
+ZYba:1408
+PzZu:1409
+CZbg:1410
+PzZm:1411
+ZYba:1412
+CZbg:1413
+Org:1414
+DSg:1415
+ZYba:1416
+CZg:1417
+Tec:1418
+PzZu:1419
+ZYba:1420
+Tecs:1421
+ZYba:1422
+ZYba:1423
+CZgms:1424
+ZYba:1425
+ZYbA:1426
+Tor:1427
+Zata:1428
+CZam:1429
+Zman:1430
+Tpy:1431
+PzZu:1432
+TRc:1433
+Zch:1434
+PzZu:1435
+CZmd:1436
+Zco:1437
+Zata:1438
+ZYba:1439
+DOg:1440
+Tp:1441
+PzZu:1442
+Tpy:1443
+PzZm:1444
+DOgb:1445
+PzZu:1446
+PzZu:1447
+DSc:1448
+SOgg:1449
+ZYba:1450
+Zata:1451
+Km:1452
+Tec:1453
+Zco:1454
+ZYba:1455
+CZam:1456
+ZYba:1457
+Tpy:1458
+Km:1459
+Tpy:1460
+ZYba:1461
+CZiv:1462
+PzZu:1463
+Zatb:1464
+Tp:1465
+Tp:1466
+Zgs:1467
+PzZq:1468
+PzZq:1469
+Tor:1470
+Km:1471
+CZam:1472
+Tp:1473
+Qp:1474
+Zata:1475
+Qp:1476
+Zman:1477
+Qp:1478
+ZYba:1479
+Dqd:1480
+Tec:1481
+Kc:1482
+DOgb:1483
+Zata:1484
+Zman:1485
+CZmd3:1486
+Zata:1487
+Zch:1488
+TRc:1489
+Tp:1490
+CZfv:1491
+CZfv2:1492
+Zata:1493
+Zata:1494
+Zatb:1495
+ZYba:1496
+CZg:1497
+Qp:1498
+Qp:1499
+Tp:1500
+TRc:1501
+DOgb:1502
+DOg:1503
+Zch:1504
+Tp:1505
+Qp:1506
+ZYba:1507
+Qp:1508
+Zhha:1509
+PzZu:1510
+Zatb:1511
+Zata:1512
+Tpy:1513
+Tp:1514
+Tec:1515
+DSs:1516
+Tp:1517
+CZg:1518
+PzZu:1519
+Tpy:1520
+ZYba:1521
+CZmd:1522
+DOgb:1523
+DSg:1524
+Tpy:1525
+PPg:1526
+Kb:1527
+CZfv2:1528
+Qp:1529
+Tp:1530
+Tec:1531
+TRc:1532
+Qp:1533
+Km:1534
+CZph:1535
+TRc:1536
+Tp:1537
+Kb:1538
+Tec:1539
+Km:1540
+CZmd:1541
+CZmd:1542
+Qp:1543
+TRc:1544
+Qp:1545
+Km:1546
+Qp:1547
+Qp:1548
+Tp:1549
+Qp:1550
+Tob:1551
+Qp:1552
+Qp:1553
+Qp:1554
+Qp:1555
+Qp:1556
+Tpy:1557
+Qp:1558
+CZph:1559
+CZg:1560
+Tt:1561
+Qp:1562
+Km:1563
+PPg:1564
+Qp:1565
+Qp:1566
+Tt:1567
+CZph:1568
+Tp:1569
+Qp:1570
+Km:1571
+Qp:1572
+CZph:1573
+Qp:1574
+Qp:1575
+Qp:1576
+Qp:1577
+Tt:1578
+CZph:1579
+Km:1580
+Kb:1581
+Tpy:1582
+Tt:1583
+PPgb:1584
+CZph:1585
+Tpy:1586
+Qp:1587
+Tec:1588
+CZfv:1589
+Km:1590
+Qp:1591
+Qp:1592
+CZph:1593
+Km:1594
+CZmd:1595
+CZbg:1596
+CZg:1597
+Km:1598
+CZmd:1599
+Km:1600
+Km:1601
+Km:1602
+Km:1603
+Tp:1604
+CZmd:1605
+Km:1606
+Qp:1607
+Km:1608
+CZmd:1609
+Tt:1610
+CZph:1611
+Km:1612
+PzZm:1613
+CZph:1614
+CZph:1615
+CZph:1616
+CZmd:1617
+CZph:1618
+Tec:1619
+CZmd:1620
+Km:1621
+CZmd:1622
+CZph:1623
+CZph:1624
+CZph:1625
+Tpy:1626
+Tt:1627
+CZmd:1628
+Qp:1629
+CZph:1630
+Km:1631
+Qp:1632
+Qp:1633
+CZmd:1634
+Km:1635
+Km:1636
+Tec:1637
+Qp:1638
+Qp:1639
+Qp:1640
+Qp:1641
+Qp:1642
+Qp:1643
+Tpy:1644
+Tpy:1645
+Qp:1646
+Qp:1647
+Qp:1648
+Qp:1649
+Tpy:1650
+Qp:1651
+Qp:1652
+Qp:1653
+Tpy:1654
+Qp:1655
+Qp:1656
+Qp:1657
+Qp:1658
+Qp:1659
+Qp:1660
+Qp:1661
+Qp:1662
+Qp:1663
+Qp:1664
+Qp:1665
+Qp:1666
+Qp:1667
+Qp:1668
+Tob:1669
+Qp:1670
+Qp:1671
+Qp:1672
+Qp:1673
+Qp:1674
+Qp:1675
+Qp:1676
+Qp:1677
+Qp:1678
+Qp:1679
+Qp:1680
+Qp:1681
+Qp:1682
+Qp:1683
+Qp:1684
+Qp:1685
+Tpy:1686
+Qp:1687
+Qp:1688
+Qp:1689
+Qp:1690
+Tpy:1691
+Tpy:1692
+Qp:1693
+Qp:1694
+Qp:1695
+Qp:1696
+Tpy:1697
+Qp:1698
+Qp:1699
+Qp:1700
+Qp:1701
+Qp:1702
+Qp:1703
+Qp:1704
+Qp:1705
+Qp:1706
+Qp:1707
+Qp:1708
+Qp:1709
+Qp:1710
+Qp:1711
+Qp:1712
+Qp:1713
+Tec:1714
+Qp:1715
+Qp:1716
+Qp:1717
+Qp:1718
+Qp:1719
+Qp:1720
+Qp:1721
+Qp:1722
+Qp:1723
+Qp:1724
+Qp:1725
+Qp:1726
+Qp:1727
+Qp:1728
+Qp:1729
+Qp:1730
+Qp:1731
+Qp:1732
+Qp:1733
+Qp:1734
+Tpyw:1735
+Tor:1736
+Qp:1737
+Tor:1738
+Tpyw:1739
+Qp:1740
+Qp:1741
+Qp:1742
+Qp:1743
+Qp:1744
+Qp:1745
+Qp:1746
+Qp:1747
+Qp:1748
+Qp:1749
+Qp:1750
+Tpa:1751
+Qp:1752
+Qp:1753
+Qp:1754
+Qp:1755
+Qp:1756
+Qp:1757
+Qp:1758
+Qp:1759
+Qp:1760
+Tpyw:1761
+Qp:1762
+Qp:1763
+Qp:1764
+Qp:1765
+Qp:1766
+Qp:1767
+Tpyw:1768
+Qp:1769
+Qp:1770
+Qp:1771
+Qp:1772
+Tpy:1773
+Tpyw:1774
+Tpyw:1775
+Qp:1776
+Kb:1777
+Qp:1778
+Qp:1779
+Kp:1780
+Tpyw:1781
+Qp:1782
+Tpyw:1783
+Kp:1784
+Qp:1785
+Tpy:1786
+Qp:1787
+Tpyw:1788
+Qp:1789
+Qp:1790
+Qp:1791
+Qp:1792
+Qp:1793
+Qp:1794
+Qp:1795
+Qp:1796
+Qp:1797
+Tpyw:1798
+Qp:1799
+Qp:1800
+Qp:1801
+Tec:1802
+Qp:1803
+Tec:1804
+Tec:1805
+Tec:1806
+Qp:1807
+Tec:1808
+Tec:1809
+Qp:1810
+Qp:1811
+Qp:1812
+Qp:1813
+Qp:1814
+Tpyw:1815
+Qp:1816
+Tpyw:1817
+Qp:1818
+Qp:1819
+Qp:1820
+Qp:1821
+Qp:1822
+Qp:1823
+Qp:1824
+Qp:1825
+Qp:1826
+Tpyw:1827
+Tpyw:1828
+Tpyw:1829
+Tpyw:1830
+Tpyw:1831
+Tpyw:1832
\ No newline at end of file

Added: grass/trunk/lib/python/pygrass/raster/testsuite/test_category.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/testsuite/test_category.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/raster/testsuite/test_category.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Sep 15 17:09:40 2014
+
+ at author: lucadelu
+"""
+
+from grass.gunittest import TestCase, test
+
+from grass.pygrass.raster import RasterRow
+from grass.pygrass.raster.category import Category
+from grass.script.core import tempfile
+
+
+class RasterCategoryTestCate(TestCase):
+
+    name = 'geology'
+    catsname = ''
+
+    def testCategory(self):
+        r = RasterRow(self.name)
+        r.open()
+        cats = r.cats
+        cats1 = Category(self.name)
+        cats1.read()
+        # this is not working, I don't know why
+        self.assertEqual(cats, cats1)
+        r.close()
+
+    def testFirstCat(self):
+        cat0 = ('Zml', 1, None)
+        cats = Category(self.name)
+        cats.read()
+        self.assertEqual(cats[0], cat0)
+
+    def testWrite(self):
+        tmpfile = tempfile(False)
+        cats = Category(self.name)
+        cats.read()
+        cats.write_rules(tmpfile)
+        self.assertFilesEqualMd5(tmpfile, 'data/geology_cats')
+
+
+if __name__ == '__main__':
+    test()

Added: grass/trunk/lib/python/pygrass/raster/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/raster/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.raster as pgrass
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(pgrass))
+    tests.addTests(doctest.DocTestSuite(pgrass.abstract))
+    tests.addTests(doctest.DocTestSuite(pgrass.category))
+    tests.addTests(doctest.DocTestSuite(pgrass.history))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/raster/testsuite/test_history.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/testsuite/test_history.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/raster/testsuite/test_history.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Sep 15 17:09:40 2014
+
+ at author: lucadelu
+"""
+
+from grass.gunittest import TestCase, test
+
+from grass.pygrass.raster import RasterRow
+from grass.pygrass.raster.history import History
+
+
+class RasterHistoryTestCate(TestCase):
+
+    name = 'geology'
+
+    def testHistory(self):
+        r = RasterRow(self.name)
+        r.open()
+        hist = r.hist
+        hist1 = History(self.name)
+        hist1.read()
+        # this is not working, I don't know why
+        #self.assertEqual(hist, hist1)
+        self.assertEqual(hist.creator, hist1.creator)
+        hist1.creator = 'markus'
+        self.assertNotEqual(hist.creator, hist1.creator)
+        r.close()
+
+
+if __name__ == '__main__':
+    test()

Added: grass/trunk/lib/python/pygrass/raster/testsuite/test_raster.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/testsuite/test_raster.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/raster/testsuite/test_raster.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Sep 15 13:37:24 2014
+
+ at author: lucadelu
+"""
+
+from grass.gunittest import TestCase, test
+
+from grass.pygrass.raster import RasterRow
+
+
+class RasterRowTestCate(TestCase):
+
+    name = 'elevation'
+
+    def test_type(self):
+        eletype = 'FCELL'
+        r = RasterRow(self.name)
+        r.open()
+        self.assertTrue(r.mtype, eletype)
+        r.close()
+
+    def test_isopen(self):
+        r = RasterRow(self.name)
+        self.assertFalse(r.is_open())
+        r.open()
+        self.assertTrue(r.is_open())
+        r.close()
+
+    def test_name(self):
+        r = RasterRow(self.name)
+        r.open()
+        self.assertEqual(r.name, self.name)
+        fullname = "{name}@{mapset}".format(name=r.name, mapset=r.mapset)
+        self.assertEqual(r.fullname(), fullname)
+        r.close()
+
+
+if __name__ == '__main__':
+    test()

Added: grass/trunk/lib/python/pygrass/shell/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/shell/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/shell/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.shell as gshell
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(gshell.conversion))
+    tests.addTests(doctest.DocTestSuite(gshell.show))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.functions as gfunctions
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(gfunctions))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()

Added: grass/trunk/lib/python/pygrass/vector/testsuite/test_doctests.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/testsuite/test_doctests.py	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/vector/testsuite/test_doctests.py	2014-09-16 08:27:00 UTC (rev 61991)
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+"""
+Tests checkers
+"""
+
+import doctest
+
+import grass.gunittest
+import grass.gunittest.utils
+
+import grass.pygrass.vector as gvector
+
+
+# doctest does not allow changing the base classes of test case, skip test case
+# and test suite, so we need to create a new type which inherits from our class
+# and contains doctest's methods
+# the alternative is to copy 500 from doctest and change what is needed
+# (this might be necessary anyway beacuse of the reports and stdout and stderr)
+doctest.DocFileCase = type('DocFileCase',
+                           (grass.gunittest.TestCase,),
+                           dict(doctest.DocFileCase.__dict__))
+doctest.SkipDocTestCase = type('SkipDocTestCase',
+                               (grass.gunittest.TestCase,),
+                               dict(doctest.SkipDocTestCase.__dict__))
+
+
+def load_tests(loader, tests, ignore):
+    # TODO: this must be somewhere when doctest is called, not here
+    # TODO: ultimate solution is not to use _ as a buildin in lib/python
+    # for now it is the only place where it works
+    grass.gunittest.utils.do_doctest_gettext_workaround()
+    # this should be called at some top level
+    tests.addTests(doctest.DocTestSuite(gvector))
+    tests.addTests(doctest.DocTestSuite(gvector.abstract))
+    tests.addTests(doctest.DocTestSuite(gvector.basic))
+    tests.addTests(doctest.DocTestSuite(gvector.find))
+    tests.addTests(doctest.DocTestSuite(gvector.geometry))
+    tests.addTests(doctest.DocTestSuite(gvector.sql))
+    tests.addTests(doctest.DocTestSuite(gvector.table))
+    return tests
+
+
+if __name__ == '__main__':
+    grass.gunittest.test()



More information about the grass-commit mailing list