-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: test monitor API information routes client (#57)
- Loading branch information
1 parent
df9be9a
commit 4b9cc61
Showing
8 changed files
with
138 additions
and
0 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,13 @@ | ||
.. _api_tag_page: | ||
|
||
nisystemlink.clients.testmonitor | ||
====================== | ||
|
||
.. autoclass:: nisystemlink.clients.testmonitor.TestMonitorClient | ||
:exclude-members: __init__ | ||
|
||
.. automethod:: __init__ | ||
|
||
.. automodule:: nisystemlink.clients.testmonitor.models | ||
:members: | ||
:imported-members: |
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,3 @@ | ||
from ._test_monitor_client import TestMonitorClient | ||
|
||
# flake8: noqa |
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,28 @@ | ||
"""Implementation of TestMonitor Client""" | ||
|
||
from typing import Optional | ||
|
||
from nisystemlink.clients import core | ||
from nisystemlink.clients.core._uplink._base_client import BaseClient | ||
from nisystemlink.clients.core._uplink._methods import get | ||
|
||
from . import models | ||
|
||
|
||
class TestMonitorClient(BaseClient): | ||
def __init__(self, configuration: Optional[core.HttpConfiguration]): | ||
if configuration is None: | ||
configuration = core.JupyterHttpConfiguration() | ||
super().__init__(configuration, base_path="/nitestmonitor/v2/") | ||
|
||
@get("") | ||
def api_info(self) -> models.ApiInfo: | ||
"""Get information about the available API operations. | ||
Returns: | ||
Information about available API operations. | ||
Raises: | ||
ApiException: if unable to communicate with the `nitestmonitor` service. | ||
""" | ||
... |
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,3 @@ | ||
from ._api_info import Operation, V2Operations, ApiInfo | ||
|
||
# flake8: noqa |
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,72 @@ | ||
from nisystemlink.clients.core._api_info import Operation | ||
from nisystemlink.clients.core._uplink._json_model import JsonModel | ||
|
||
|
||
class V2Operations(JsonModel): | ||
"""The operations available in the routes provided by the v2 HTTP API.""" | ||
|
||
get_products: Operation | ||
"""The ability to get a list of products.""" | ||
|
||
query_products: Operation | ||
"""The ability to query products based on their properties.""" | ||
|
||
create_products: Operation | ||
"""The ability to create one or more products.""" | ||
|
||
update_products: Operation | ||
"""The ability to update the properties of one or more products.""" | ||
|
||
delete_products: Operation | ||
"""The ability to delete a single products.""" | ||
|
||
delete_many_products: Operation | ||
"""The ability to delete a list of products.""" | ||
|
||
get_results: Operation | ||
"""The ability to get a list of results.""" | ||
|
||
get_results_property_keys: Operation | ||
"""The ability to get custom property keys.""" | ||
|
||
query_results: Operation | ||
""""The ability to to query results based on their properties.""" | ||
|
||
create_results: Operation | ||
"""The ability to create results.""" | ||
|
||
update_results: Operation | ||
"""The ability to update results.""" | ||
|
||
delete_result: Operation | ||
"""The ability to delete a single results.""" | ||
|
||
delete_many_results: Operation | ||
"""The ability to delete multiple results.""" | ||
|
||
get_steps: Operation | ||
"""The ability to get a list of steps.""" | ||
|
||
query_steps: Operation | ||
"""The ability to query steps based on their properties.""" | ||
|
||
create_steps: Operation | ||
"""The ability to create steps.""" | ||
|
||
update_steps: Operation | ||
"""The ability to update steps.""" | ||
|
||
delete_step: Operation | ||
"""The ability to delete a single step.""" | ||
|
||
delete_many_steps: Operation | ||
"""The ability to delete multiple steps.""" | ||
|
||
query_paths: Operation | ||
"""The ability to query step paths.""" | ||
|
||
|
||
class ApiInfo(JsonModel): | ||
"""Information about the available API operations.""" | ||
|
||
operations: V2Operations |
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 @@ | ||
# flake8: noqa |
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,17 @@ | ||
import pytest | ||
from nisystemlink.clients.core._http_configuration import HttpConfiguration | ||
from nisystemlink.clients.testmonitor import TestMonitorClient | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def client(enterprise_config: HttpConfiguration) -> TestMonitorClient: | ||
"""Fixture to create a TestMonitorClient instance.""" | ||
return TestMonitorClient(enterprise_config) | ||
|
||
|
||
@pytest.mark.integration | ||
@pytest.mark.enterprise | ||
class TestTestMonitor: | ||
def test__api_info__returns(self, client: TestMonitorClient): | ||
response = client.api_info() | ||
assert len(response.dict()) != 0 |