-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from p0cisk/master
Added support for load_map_from_string in BaseWMSFactory.loadXML method (2)
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import nose | ||
import os | ||
from ogcserver.WMS import BaseWMSFactory | ||
from ogcserver.exceptions import ServerConfigurationError | ||
|
||
def test_wms_capabilities(): | ||
wms = BaseWMSFactory() | ||
nose.tools.assert_raises(ServerConfigurationError, wms.loadXML) | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import nose | ||
import os | ||
from ogcserver.WMS import BaseWMSFactory | ||
|
||
def test_wms_capabilities(): | ||
base_path, tail = os.path.split(__file__) | ||
file_path = os.path.join(base_path, 'mapfile_encoding.xml') | ||
wms = BaseWMSFactory() | ||
with open(file_path) as f: | ||
settings = f.read() | ||
wms.loadXML(xmlstring=settings, basepath=base_path) | ||
wms.finalize() | ||
|
||
if len(wms.layers) != 1: | ||
raise Exception('Incorrect number of layers') | ||
if len(wms.styles) != 1: | ||
raise Exception('Incorrect number of styles') | ||
|
||
return True |