Beispiel #1
0
 def testConstructorFilename(self):
     """imageObj with a filename works"""
     imgobj = mapscript.imageObj(test_image)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
     imgobj.save('testConstructorFilename.png')
Beispiel #2
0
 def setUp(self):
     MapTestCase.setUp(self)
     f = open(HOME_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.h_symbol = mapscript.symbolObj('house')
     self.h_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.h_symbol.setImage(symb_img)
     f = open(XMARKS_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.x_symbol = mapscript.symbolObj('xmarks')
     self.x_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.x_symbol.setImage(symb_img)
Beispiel #3
0
 def testConstructorFilename(self):
     """imageObj with a filename works"""
     imgobj = mapscript.imageObj(test_image)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
     imgobj.save('testConstructorFilename.png')
Beispiel #4
0
 def setUp(self):
     MapTestCase.setUp(self)
     f = open(HOME_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.h_symbol = mapscript.symbolObj('house')
     self.h_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.h_symbol.setImage(symb_img)
     f = open(XMARKS_IMAGE, 'rb')
     s = StringIO.StringIO(f.read())
     f.close()
     symb_img = mapscript.imageObj(s)
     self.x_symbol = mapscript.symbolObj('xmarks')
     self.x_symbol.type = mapscript.MS_SYMBOL_PIXMAP
     self.x_symbol.setImage(symb_img)
Beispiel #5
0
 def testConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.gis.umn.edu/logo.jpg')
     imgobj = mapscript.imageObj(url, 'GD/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Beispiel #6
0
 def testConstructorStream(self):
     """imageObj with a file stream works"""
     f = open(test_image, 'rb')
     imgobj = mapscript.imageObj(f)
     f.close()
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Beispiel #7
0
 def testConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.gis.umn.edu/logo.jpg')
     imgobj = mapscript.imageObj(url, 'GD/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Beispiel #8
0
 def testConstructorStream(self):
     """imageObj with a file stream works"""
     f = open(test_image, 'rb')
     imgobj = mapscript.imageObj(f)
     f.close()
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Beispiel #9
0
 def xtestConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.org/_static/banner.png')
     imgobj = mapscript.imageObj(url, 'AGG/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Beispiel #10
0
 def xtestConstructorUrlStream(self):
     """imageObj with a URL stream works"""
     url = urllib.urlopen('http://mapserver.org/_static/banner.png')
     imgobj = mapscript.imageObj(url, 'AGG/JPEG')
     assert imgobj.thisown == 1
     assert imgobj.height == 68
     assert imgobj.width == 439
     imgobj.save('testConstructorUrlStream.jpg')
Beispiel #11
0
 def testConstructorWithFormat(self):
     """imageObj with an optional driver works"""
     driver = 'GD/PNG'
     format = mapscript.outputFormatObj(driver)
     imgobj = mapscript.imageObj(10, 10, format)
     assert imgobj.thisown == 1
     assert imgobj.format.driver == driver
     assert imgobj.height == 10
     assert imgobj.width == 10
Beispiel #12
0
 def testConstructorWithFormat(self):
     """imageObj with an optional driver works"""
     driver = 'GD/PNG'
     format = mapscript.outputFormatObj(driver)
     imgobj = mapscript.imageObj(10, 10, format)
     assert imgobj.thisown == 1
     assert imgobj.format.driver == driver
     assert imgobj.height == 10
     assert imgobj.width == 10
Beispiel #13
0
 def testConstructorStringIO(self):
     """imageObj with a cStringIO works"""
     f = open(test_image, 'rb')
     data = f.read()
     f.close()
     s = cStringIO.StringIO(data)
     imgobj = mapscript.imageObj(s)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Beispiel #14
0
 def testConstructorStringIO(self):
     """imageObj with a cStringIO works"""
     f = open(test_image, 'rb')
     data = f.read()
     f.close()
     s = cStringIO.StringIO(data)
     imgobj = mapscript.imageObj(s)
     assert imgobj.thisown == 1
     assert imgobj.height == 200
     assert imgobj.width == 200
Beispiel #15
0
 def testConstructor(self):
     """imageObj constructor works"""
     imgobj = mapscript.imageObj(10, 10)
     assert imgobj.thisown == 1
     assert imgobj.height == 10
     assert imgobj.width == 10
Beispiel #16
0
 def testConstructor(self):
     """imageObj constructor works"""
     imgobj = mapscript.imageObj(10, 10)
     assert imgobj.thisown == 1
     assert imgobj.height == 10
     assert imgobj.width == 10