Skip to content

Commit 4b78269

Browse files
committed
DI-26927 fixed linting error
1 parent bdc6be8 commit 4b78269

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

linode_api4/groups/monitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
from linode_api4.errors import UnexpectedResponseError
88
from linode_api4.groups import Group
99
from linode_api4.objects import (
10+
AlertChannel,
11+
AlertChannelEnvelope,
12+
AlertDefinition,
1013
MonitorDashboard,
1114
MonitorMetricsDefinition,
1215
MonitorService,
1316
MonitorServiceToken,
14-
AlertDefinition,
15-
AlertChannel,
1617
RuleCriteria,
1718
TriggerConditions,
18-
AlertChannelEnvelope
1919
)
2020

2121

linode_api4/objects/monitor.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
]
1414
from dataclasses import dataclass, field
1515
from enum import Enum
16-
from typing import List, Optional, Literal, Union
16+
from typing import List, Literal, Optional, Union
1717

1818
from linode_api4.objects.base import Base, Property
1919
from linode_api4.objects.serializable import JSONObject, StrEnum
@@ -348,12 +348,10 @@ def _populate(self, json):
348348
"""
349349
Populates this object with data from a JSON dictionary.
350350
"""
351-
for key, value in json.items():
352-
#class and type are reserved words in Python.
353-
reserved = {"class": "_class", "type": "_type"}
354-
for json_key, json_value in json.items():
355-
attr = reserved.get(json_key, json_key)
356-
setattr(self, attr, json_value)
351+
reserved = {"class": "_class", "type": "_type"}
352+
for json_key, json_value in json.items():
353+
attr = reserved.get(json_key, json_key)
354+
setattr(self, attr, json_value)
357355

358356

359357
@dataclass

test/integration/models/monitor/test_monitor.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
from test.integration.helpers import (
2-
get_test_label,
3-
send_request_when_resource_available,
4-
wait_for_condition,
5-
)
6-
7-
import pytest
81
import time
92

10-
from linode_api4 import LinodeClient
11-
from linode_api4 import ApiError
3+
import pytest
4+
from linode_api4 import ApiError, LinodeClient
125
from linode_api4.objects import (
136
MonitorDashboard,
147
MonitorMetricsDefinition,
158
MonitorService,
169
MonitorServiceToken,
1710
)
1811

12+
from test.integration.helpers import (
13+
get_test_label,
14+
send_request_when_resource_available,
15+
wait_for_condition,
16+
)
17+
1918

2019
# List all dashboards
2120
def test_get_all_dashboards(test_linode_client):

test/unit/groups/monitor_api_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from test.unit.base import MonitorClientBaseCase
2-
31
from linode_api4.objects import (
2+
AlertDefinition,
43
AggregateFunction,
54
EntityMetricOptions,
6-
AlertDefinition,
75
)
86

7+
from test.unit.base import MonitorClientBaseCase
8+
99

1010
class MonitorAPITest(MonitorClientBaseCase):
1111
"""

0 commit comments

Comments
 (0)