Пример #1
0
 def testError(self):
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbola = mapscript.symbolObj('testa')
     symbolb = mapscript.symbolObj('testb')
     symbolset.appendSymbol(symbola) 
     symbolset.appendSymbol(symbolb)
     self.assertRaises(mapscript.MapServerError, symbolset.save, '/bogus/new_symbols.txt')
Пример #2
0
 def testError(self):
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbola = mapscript.symbolObj('testa')
     symbolb = mapscript.symbolObj('testb')
     symbolset.appendSymbol(symbola)
     symbolset.appendSymbol(symbolb)
     self.assertRaises(mapscript.MapServerError, symbolset.save,
                       '/bogus/new_symbols.txt')
Пример #3
0
 def testSaveNewSymbolSet(self):
     """save a new SymbolSet to disk"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbola = mapscript.symbolObj('testa')
     symbolb = mapscript.symbolObj('testb')
     symbolset.appendSymbol(symbola)
     symbolset.appendSymbol(symbolb)
     assert symbolset.save('new_symbols.txt') == mapscript.MS_SUCCESS
Пример #4
0
 def testSaveNewSymbolSet(self):
     """save a new SymbolSet to disk"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbola = mapscript.symbolObj('testa')
     symbolb = mapscript.symbolObj('testb')
     symbolset.appendSymbol(symbola) 
     symbolset.appendSymbol(symbolb)
     assert symbolset.save('new_symbols.txt') == mapscript.MS_SUCCESS
Пример #5
0
 def testAddSymbolToNewSymbolSet(self):
     """add two new symbols to a SymbolSet"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbola = mapscript.symbolObj('testa')
     symbolb = mapscript.symbolObj('testb')
     symbolset.appendSymbol(symbola)
     symbolset.appendSymbol(symbolb)
     num = symbolset.numsymbols
     assert num == 6, num
     names = [None, 'circle', 'xmarks-png', 'home-png', 'testa', 'testb']
     for i in range(symbolset.numsymbols):
         symbol = symbolset.getSymbol(i)
         assert symbol.name == names[i], symbol.name
Пример #6
0
 def testAddSymbolToNewSymbolSet(self):
     """add two new symbols to a SymbolSet"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbola = mapscript.symbolObj('testa')
     symbolb = mapscript.symbolObj('testb')
     symbolset.appendSymbol(symbola) 
     symbolset.appendSymbol(symbolb) 
     num = symbolset.numsymbols
     assert num == 6, num
     names = [None, 'circle', 'xmarks-png', 'home-png', 'testa', 'testb']
     for i in range(symbolset.numsymbols):
         symbol = symbolset.getSymbol(i)
         assert symbol.name == names[i], symbol.name
Пример #7
0
 def testRemoveSymbolFromNewSymbolSet(self):
     """after removing a symbol, expect numsymbols -= 1"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbolset.removeSymbol(1)
     num = symbolset.numsymbols
     assert num == 3, num
Пример #8
0
 def testConstructorFile(self):
     """new instance of symbolSetObj from symbols.txt"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     num = symbolset.numsymbols
     assert num == 4, num
Пример #9
0
 def testConstructorNoArgs(self):
     """new instance of symbolSetObj should have one symbol"""
     symbolset = mapscript.symbolSetObj()
     num = symbolset.numsymbols
     assert num == 1, num
Пример #10
0
 def testRemoveSymbolFromNewSymbolSet(self):
     """after removing a symbol, expect numsymbols -= 1"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     symbolset.removeSymbol(1)
     num = symbolset.numsymbols
     assert num == 3, num
Пример #11
0
 def testConstructorFile(self):
     """new instance of symbolSetObj from symbols.txt"""
     symbolset = mapscript.symbolSetObj(SYMBOLSET)
     num = symbolset.numsymbols
     assert num == 4, num
Пример #12
0
 def testConstructorNoArgs(self):
     """new instance of symbolSetObj should have one symbol"""
     symbolset = mapscript.symbolSetObj()
     num = symbolset.numsymbols
     assert num == 1, num