From 190287659cb92126b7687af666cbae15693de599 Mon Sep 17 00:00:00 2001 From: Patrick Keroulas Date: Tue, 28 Nov 2023 15:49:55 -0500 Subject: [PATCH] IS-13: add basic API tests Successfully tested against: https://github.com/garethsb/nmos-cpp/commit/04ac4fd0893828a3d197b1c6c12f7c70e8990dda https://github.com/AMWA-TV/is-13/commit/8655e0ce019341a21fc607c9d91ccea9b8a0db7b --- README.md | 1 + nmostesting/Config.py | 11 ++++++++++ nmostesting/NMOSTesting.py | 9 ++++++++ nmostesting/suites/IS1301Test.py | 35 ++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 nmostesting/suites/IS1301Test.py diff --git a/README.md b/README.md index 01bed2c7..febf3e81 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ The following test suites are currently supported. | IS-09-01 | IS-09 System API | | (X) | | System Parameters Server | | IS-09-02 | IS-09 System API Discovery | X | | | | | IS-10-01 | IS-10 Authorization API | | | | Authorization Server | +| IS-13-01 | IS-13 Annotation API | X | | | | | - | BCP-002-01 Natural Grouping | X | | | Included in IS-04 Node API suite | | - | BCP-002-02 Asset Distinguishing Information | X | | | Included in IS-04 Node API suite | | BCP-003-01 | BCP-003-01 Secure Communication | X | X | | See [Testing TLS](docs/2.2.%20Usage%20-%20Testing%20BCP-003-01%20TLS.md) | diff --git a/nmostesting/Config.py b/nmostesting/Config.py index c663ec91..0a2240b3 100644 --- a/nmostesting/Config.py +++ b/nmostesting/Config.py @@ -280,6 +280,17 @@ } } }, + "is-13": { + "repo": "is-13", + "versions": ["v1.0"], + "default_version": "v1.0", + "apis": { + "annotation": { + "name": "Annotation API", + "raml": "AnnotationAPI.raml" + } + } + }, "bcp-002-01": { "repo": "bcp-002-01", "versions": ["v1.0"], diff --git a/nmostesting/NMOSTesting.py b/nmostesting/NMOSTesting.py index e4860827..b5dee403 100644 --- a/nmostesting/NMOSTesting.py +++ b/nmostesting/NMOSTesting.py @@ -82,6 +82,7 @@ from .suites import IS0901Test from .suites import IS0902Test # from .suites import IS1001Test +from .suites import IS1301Test from .suites import BCP00301Test from .suites import BCP0060101Test from .suites import BCP0060102Test @@ -340,6 +341,14 @@ # }], # "class": IS1001Test.IS1001Test # }, + "IS-13-01": { + "name": "IS-13 Annotation API", + "specs": [{ + "spec_key": "is-13", + "api_key": "annotation" + }], + "class": IS1301Test.IS1301Test, + }, "BCP-003-01": { "name": "BCP-003-01 Secure Communication", "specs": [{ diff --git a/nmostesting/suites/IS1301Test.py b/nmostesting/suites/IS1301Test.py new file mode 100644 index 00000000..e66756b8 --- /dev/null +++ b/nmostesting/suites/IS1301Test.py @@ -0,0 +1,35 @@ +# Copyright (C) 2023 Advanced Media Workflow Association +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ..GenericTest import GenericTest, NMOSTestException +from ..TestHelper import compare_json + +ANNOTATION_API_KEY = "annotation" + + +class IS1301Test(GenericTest): + """ + Runs IS-13-Test + """ + def __init__(self, apis, **kwargs): + GenericTest.__init__(self, apis, **kwargs) + self.annotation_url = self.apis[ANNOTATION_API_KEY]["url"] + + def test_01(self, test): + """ 1st annotation test """ + + if compare_json({}, {}): + return test.PASS() + else: + return test.FAIL("IO Resource does not correctly reflect the API resources")