Skip to content

Commit 6a9c333

Browse files
committed
🎨 yapf format
Signed-off-by: ff137 <[email protected]>
1 parent 9c83986 commit 6a9c333

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

nats/js/manager.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ async def purge_stream(
173173

174174
req = json.dump_bytes(stream_req)
175175
resp = await self._api_request(
176-
f"{self._prefix}.STREAM.PURGE.{name}",
177-
req,
178-
timeout=self._timeout
176+
f"{self._prefix}.STREAM.PURGE.{name}", req, timeout=self._timeout
179177
)
180178
return resp["success"]
181179

@@ -198,9 +196,7 @@ async def streams_info(self, offset=0) -> List[api.StreamInfo]:
198196
"""
199197
resp = await self._api_request(
200198
f"{self._prefix}.STREAM.LIST",
201-
json.dump_bytes({
202-
"offset": offset
203-
}),
199+
json.dump_bytes({"offset": offset}),
204200
timeout=self._timeout,
205201
)
206202
streams = []
@@ -216,9 +212,7 @@ async def streams_info_iterator(self,
216212
"""
217213
resp = await self._api_request(
218214
f"{self._prefix}.STREAM.LIST",
219-
json.dump_bytes({
220-
"offset": offset
221-
}),
215+
json.dump_bytes({"offset": offset}),
222216
timeout=self._timeout,
223217
)
224218

@@ -283,9 +277,7 @@ async def consumers_info(
283277
"""
284278
resp = await self._api_request(
285279
f"{self._prefix}.CONSUMER.LIST.{stream}",
286-
b"" if offset is None else json.dump_bytes({
287-
"offset": offset
288-
}),
280+
b"" if offset is None else json.dump_bytes({"offset": offset}),
289281
timeout=self._timeout,
290282
)
291283
consumers = []

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_default_connect_command(self):
3737
nc.options["no_echo"] = False
3838
got = nc._connect_command()
3939
expected = f'CONNECT {{"echo": true, "lang": "python3", "pedantic": false, "protocol": 1, "verbose": false, "version": "{__version__}"}}\r\n'
40-
40+
4141
try:
4242
import orjson
4343
# If using orjson, expected string is without spaces

tests/test_micro_service.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,7 @@ async def add_handler(request: Request):
7777
svcs.append(svc)
7878

7979
for _ in range(50):
80-
await nc.request(
81-
"svc.add",
82-
json.dump_bytes({
83-
"x": 22,
84-
"y": 11
85-
})
86-
)
80+
await nc.request("svc.add", json.dump_bytes({"x": 22, "y": 11}))
8781

8882
for svc in svcs:
8983
info = svc.info()

0 commit comments

Comments
 (0)