Skip to content

Commit

Permalink
IS-13: add basic API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pkeroulas committed Jan 17, 2024
1 parent ebd4787 commit 1902876
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
11 changes: 11 additions & 0 deletions nmostesting/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
9 changes: 9 additions & 0 deletions nmostesting/NMOSTesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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": [{
Expand Down
35 changes: 35 additions & 0 deletions nmostesting/suites/IS1301Test.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 1902876

Please sign in to comment.