-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Unit tests for test_edreq12.py.""" | ||
"""Unit tests for edreq12.py.""" | ||
|
||
import unittest | ||
import json | ||
|
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,35 @@ | ||
"""Unit tests for ogcapi10.py.""" | ||
|
||
import unittest | ||
import json | ||
import util | ||
import ogcapi10 as ogcapi | ||
|
||
|
||
class TestOGCAPI(unittest.TestCase): | ||
__version__ = "testversion" | ||
util.args = util.parse_args(["--url", "https://example.com/"], __version__) | ||
util.logger = util.set_up_logging( | ||
args=util.args, logfile=util.args.log_file, version=__version__ | ||
) | ||
|
||
def test_requirement9_1(self): | ||
# Good tests | ||
jsondata = {} | ||
with open("testdata/edrisobaric_landing.json", "r", encoding="utf-8") as f: | ||
jsondata = json.load(f) | ||
ok, _ = ogcapi.requirement9_1(jsondata) | ||
self.assertTrue(ok) | ||
|
||
# Bad tests | ||
jsondata = {} | ||
with open( | ||
"testdata/edrisobaric_landing-bad-desc.json", "r", encoding="utf-8" | ||
) as f: | ||
jsondata = json.load(f) | ||
ok, _ = ogcapi.requirement9_1(jsondata) | ||
self.assertFalse(ok) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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