Skip to content

Commit bc317a0

Browse files
committed
updating unittest and entity_id to any
1 parent faa55d3 commit bc317a0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

linode_api4/groups/monitor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__all__ = [
22
"MonitorGroup",
33
]
4-
from typing import Optional
4+
from typing import Any, Optional
55

66
from linode_api4 import (
77
PaginatedList,
@@ -30,7 +30,7 @@ def dashboards(
3030
Returns a list of dashboards. If `service_type` is provided, it fetches dashboards
3131
for the specific service type. If None, it fetches all dashboards.
3232
33-
dashboards = client.monitor_serv.dashboards()
33+
dashboards = client.monitor.dashboards()
3434
dashboard = client.load(MonitorDashboard, 1)
3535
dashboards_by_service = client.monitor.dashboards(service_type="dbaas")
3636
@@ -121,7 +121,7 @@ def metric_definitions(
121121
)
122122

123123
def create_token(
124-
self, service_type: str, entity_ids: list
124+
self, service_type: str, entity_ids: list[Any]
125125
) -> MonitorServiceToken:
126126
"""
127127
Returns a JWE Token for a specific service type.
@@ -134,7 +134,7 @@ def create_token(
134134
:param service_type: The service type to create token for.
135135
:type service_type: str
136136
:param entity_ids: The list of entity IDs for which the token is valid.
137-
:type entity_ids: list of int
137+
:type entity_ids: any
138138
139139
:returns: Returns a token for a service
140140
:rtype: str
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"token": "abcdefhjigkfghh"
3+
}

test/unit/objects/monitor.py renamed to test/unit/objects/monitor_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ def test_create_token(self):
115115
service_type="dbaas", entity_ids=[189690, 188020]
116116
)
117117
self.assertEqual(m.return_dct["token"], "abcdefhjigkfghh")
118+
119+
with self.mock_post("/monitor/services/linode/token") as m:
120+
self.client.monitor.create_token(
121+
service_type="linode", entity_ids=["compute-instance-1"]
122+
)
123+
self.assertEqual(m.return_dct["token"], "abcdefhjigkfghh")

0 commit comments

Comments
 (0)