-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update CI (drop Python 3.7, add 3.10/3.11) (#891)
* update CI (drop Python 3.7, add 3.10/3.11) * move doctest to pytest * fix test * isolate extra checks to 3.8
- Loading branch information
1 parent
94f3f41
commit 59ab2c3
Showing
4 changed files
with
49 additions
and
62 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 was deleted.
Oops, something went wrong.
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,43 @@ | ||
|
||
import pytest | ||
|
||
from owslib.namespaces import Namespaces | ||
|
||
def test_namespaces(): | ||
ns = Namespaces() | ||
|
||
assert ns.get_namespace('csw') == 'http://www.opengis.net/cat/csw/2.0.2' | ||
|
||
x = ns.get_namespaces(['csw','gmd','fes']) | ||
assert x == {'csw': 'http://www.opengis.net/cat/csw/2.0.2', 'fes': 'http://www.opengis.net/fes/2.0', 'gmd': 'http://www.isotc211.org/2005/gmd'} | ||
|
||
ns.get_namespaces() | ||
|
||
assert ns.get_versioned_namespace('ows') == 'http://www.opengis.net/ows' | ||
|
||
assert ns.get_versioned_namespace('ows','1.0.0') == 'http://www.opengis.net/ows' | ||
|
||
assert ns.get_versioned_namespace('ows','1.1.0') == 'http://www.opengis.net/ows/1.1' | ||
|
||
assert ns.get_versioned_namespace('ows','2.0.0') == 'http://www.opengis.net/ows/2.0' | ||
|
||
assert ns.get_namespaces('csw') == {'csw': 'http://www.opengis.net/cat/csw/2.0.2'} | ||
|
||
assert ns.get_namespace('csw') == 'http://www.opengis.net/cat/csw/2.0.2' | ||
|
||
assert ns.get_namespace('sa') == 'http://www.opengis.net/sampling/1.0' | ||
|
||
# 'om300' does not exist as a namespace, so the below will return nothing | ||
assert ns.get_namespace('om300') is None | ||
|
||
# CSW 3.1.1 doesn't exist, so the below will return nothing | ||
assert ns.get_versioned_namespace('csw','3.1.1') is None | ||
|
||
|
||
# Invalid Usage Tests | ||
|
||
with pytest.raises(TypeError): | ||
ns.get_namespace() | ||
|
||
with pytest.raises(TypeError): | ||
ns.get_versioned_namespace() |
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