Skip to content

Commit 6a2bba7

Browse files
Fixed lint
1 parent fb04f1b commit 6a2bba7

File tree

3 files changed

+113
-9
lines changed

3 files changed

+113
-9
lines changed

linode_api4/objects/linode.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,10 @@ def config_create(
12611261

12621262
device_limit = int(max(8, min(self.specs.memory // 1024, 64)))
12631263

1264-
device_names = [hypervisor_prefix + suffix for suffix in generate_device_suffixes(device_limit)]
1264+
device_names = [
1265+
hypervisor_prefix + suffix
1266+
for suffix in generate_device_suffixes(device_limit)
1267+
]
12651268

12661269
device_map = {
12671270
device_names[i]: None for i in range(0, len(device_names))

linode_api4/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contains various utility functions.
33
"""
44

5-
from typing import Any, Dict
65
import string
6+
from typing import Any, Dict
77

88

99
def drop_null_keys(data: Dict[Any, Any], recursive=True) -> Dict[Any, Any]:

test/unit/util_test.py

Lines changed: 108 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,116 @@ def test_generate_device_suffixes(self):
5959
Tests whether generate_device_suffixes works as expected.
6060
"""
6161

62-
expected_output_12 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"]
62+
expected_output_12 = [
63+
"a",
64+
"b",
65+
"c",
66+
"d",
67+
"e",
68+
"f",
69+
"g",
70+
"h",
71+
"i",
72+
"j",
73+
"k",
74+
"l",
75+
]
6376
assert generate_device_suffixes(12) == expected_output_12
6477

65-
expected_output_30 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
66-
"s", "t", "u", "v", "w", "x", "y", "z", "aa", "ab", "ac", "ad"]
78+
expected_output_30 = [
79+
"a",
80+
"b",
81+
"c",
82+
"d",
83+
"e",
84+
"f",
85+
"g",
86+
"h",
87+
"i",
88+
"j",
89+
"k",
90+
"l",
91+
"m",
92+
"n",
93+
"o",
94+
"p",
95+
"q",
96+
"r",
97+
"s",
98+
"t",
99+
"u",
100+
"v",
101+
"w",
102+
"x",
103+
"y",
104+
"z",
105+
"aa",
106+
"ab",
107+
"ac",
108+
"ad",
109+
]
67110
assert generate_device_suffixes(30) == expected_output_30
68111

69-
expected_output_60 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
70-
"s", "t", "u", "v", "w", "x", "y", "z", "aa", "ab", "ac", "ad", "ae", "af", "ag", "ah",
71-
"ai", "aj", "ak", "al", "am", "an", "ao", "ap", "aq", "ar", "as", "at", "au", "av", "aw",
72-
"ax", "ay", "az", "ba", "bb", "bc", "bd", "be", "bf", "bg", "bh"]
112+
expected_output_60 = [
113+
"a",
114+
"b",
115+
"c",
116+
"d",
117+
"e",
118+
"f",
119+
"g",
120+
"h",
121+
"i",
122+
"j",
123+
"k",
124+
"l",
125+
"m",
126+
"n",
127+
"o",
128+
"p",
129+
"q",
130+
"r",
131+
"s",
132+
"t",
133+
"u",
134+
"v",
135+
"w",
136+
"x",
137+
"y",
138+
"z",
139+
"aa",
140+
"ab",
141+
"ac",
142+
"ad",
143+
"ae",
144+
"af",
145+
"ag",
146+
"ah",
147+
"ai",
148+
"aj",
149+
"ak",
150+
"al",
151+
"am",
152+
"an",
153+
"ao",
154+
"ap",
155+
"aq",
156+
"ar",
157+
"as",
158+
"at",
159+
"au",
160+
"av",
161+
"aw",
162+
"ax",
163+
"ay",
164+
"az",
165+
"ba",
166+
"bb",
167+
"bc",
168+
"bd",
169+
"be",
170+
"bf",
171+
"bg",
172+
"bh",
173+
]
73174
assert generate_device_suffixes(60) == expected_output_60

0 commit comments

Comments
 (0)