Skip to content

Commit

Permalink
v.clip: add no table test (OSGeo#3423)
Browse files Browse the repository at this point in the history
  • Loading branch information
landam authored and jadenabrams100 committed Feb 21, 2024
1 parent 6717168 commit b464e65
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions scripts/v.clip/testsuite/test_v_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
for details.
"""

import os

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

Expand Down Expand Up @@ -111,6 +109,29 @@ def test_poly_diss(self):
topology = dict(areas=276)
self.assertVectorFitsTopoInfo(self.outdiss, topology)

def test_poly_notable(self):
"""Test clipping polygon with no table attached"""

def run_poly_notable(vmaps):
for vmap in vmaps:
self.runModule("g.copy", vector=[vmap + "@PERMANENT", vmap])
self.runModule("v.db.connect", map=vmap, flags="d")
self.assertModule(
"v.clip",
input=self.inpoly,
clip=self.inpclip,
output=self.outpoly,
overwrite=True,
)
for vmap in vmaps:
self.runModule("g.remove", flags="f", type="vector", name=vmap)
self.assertVectorExists(self.outpoly)
topology = dict(areas=275)
self.assertVectorFitsTopoInfo(self.outpoly, topology)

for vmaps in ([self.inpoly], [self.inpclip], [self.inpoly, self.inpclip]):
run_poly_notable(vmaps)


if __name__ == "__main__":
test()

0 comments on commit b464e65

Please sign in to comment.