test_wfs.py 872 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env python
  2. # coding=utf-8
  3. import unittest
  4. import os,sys
  5. import logging
  6. OWSVIEWER_DIR=os.path.abspath(os.path.join(os.path.dirname(__file__),".."))
  7. sys.path.append(OWSVIEWER_DIR)
  8. print OWSVIEWER_DIR
  9. from OWS import *
  10. import wfs
  11. class TestBasicOWS(unittest.TestCase):
  12. config = None
  13. newwfs = None
  14. def setUp(self):
  15. logging.basicConfig(level=logging.DEBUG)
  16. def test_getcapabilities(self):
  17. os.environ.update({"QUERY_STRING":
  18. "owsService=WFS&owsUrl=http%3A//bnhelp.cz/ows/crwfs&request=GetCapabilities&service=wms"})
  19. mywfs = getService()
  20. self.assertTrue(isinstance(mywfs, wfs.WFS))
  21. mapObj = mywfs.makeMap()
  22. self.assertTrue(isinstance(mapObj, mapscript.mapObj))
  23. self.assertEquals(mapObj.numlayers,8)
  24. pass
  25. if __name__ == "__main__":
  26. unittest.main()