Skip to content
Permalink
Browse files

Update tests to check class names and not fully qualified names (allo…

…ws direct import and install via a Wheel)
  • Loading branch information...
geographika committed Jun 27, 2018
1 parent 6ec6085 commit bab65adb470cd1048278c54af9c3d04e3e36684c
Showing with 5 additions and 10 deletions.
  1. +2 −4 mapscript/python/tests/cases/layertest.py
  2. +3 −6 mapscript/python/tests/cases/maptest.py
@@ -54,17 +54,15 @@ class LayerConstructorTestCase(MapLayerTestCase):
def testLayerConstructorNoArg(self):
"""test layer constructor with no argument"""
layer = mapscript.layerObj()
t = type(layer)
assert str(t) == "<class 'mapscript.layerObj'>", t
assert layer.__class__.__name__ == "layerObj"
assert layer.thisown == 1
assert layer.index == -1
assert layer.map == None, layer.map

def testLayerConstructorMapArg(self):
"""test layer constructor with map argument"""
layer = mapscript.layerObj(self.map)
t = type(layer)
assert str(t) == "<class 'mapscript.layerObj'>", t
assert layer.__class__.__name__ == "layerObj"
assert layer.thisown == 1
l = self.map.getLayer(self.map.numlayers-1)
# assert str(layer) == str(l) # TODO - check why these are not equal
@@ -46,22 +46,19 @@ class MapConstructorTestCase(unittest.TestCase):
def testMapConstructorNoArg(self):
"""MapConstructorTestCase.testMapConstructorNoArg: test map constructor with no argument"""
test_map = mapscript.mapObj()
maptype = type(test_map)
assert str(maptype) == "<class 'mapscript.mapObj'>", maptype
assert test_map.__class__.__name__ == "mapObj"
assert test_map.thisown == 1

def testMapConstructorEmptyStringArg(self):
"""MapConstructorTestCase.testMapConstructorEmptyStringArg: test map constructor with old-style empty string argument"""
test_map = mapscript.mapObj('')
maptype = type(test_map)
assert str(maptype) == "<class 'mapscript.mapObj'>", maptype
assert test_map.__class__.__name__ == "mapObj"
assert test_map.thisown == 1

def testMapConstructorFilenameArg(self):
"""MapConstructorTestCasetest.testMapConstructorEmptyStringArg: map constructor with filename argument"""
test_map = mapscript.mapObj(TESTMAPFILE)
maptype = type(test_map)
assert str(maptype) == "<class 'mapscript.mapObj'>", maptype
assert test_map.__class__.__name__ == "mapObj"
assert test_map.thisown == 1

class MapExtentTestCase(MapTestCase):

0 comments on commit bab65ad

Please sign in to comment.
You can’t perform that action at this time.