FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

revert: remove short prose found by the character level audit (#1852) · python-zeroconf/python-zeroconf@f01845a · GitHub

Repository navigation

Commit f01845a

Browse files
authored
revert: remove short prose found by the character level audit (#1852)
1 parent 0a53e72 commit f01845a

7 files changed

Lines changed: 2 additions & 42 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ jobs:
187187
fetch-depth: 0
188188
ref: ${{ github.ref }}
189189

190-
- name: Create local branch name
191-
env:
190+
- env:
192191
BRANCH: ${{ github.head_ref || github.ref_name }}
193192
run: git switch -C "$BRANCH"
194193

@@ -222,8 +221,7 @@ jobs:
222221
fetch-depth: 0
223222
ref: ${{ github.ref }}
224223

225-
- name: Create local branch name
226-
env:
224+
- env:
227225
BRANCH: ${{ github.ref_name }}
228226
run: git switch -C "$BRANCH"
229227

‎src/zeroconf/_dns.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ def entry_to_string(self, hdr: str, other: bytes | str | None) -> str:
106106

107107

108108
class DNSQuestion(DNSEntry):
109-
"""A DNS question entry"""
110-
111109
__slots__ = ("_hash",)
112110

113111
def __init__(self, name: str, type_: int, class_: int) -> None:
@@ -234,8 +232,6 @@ def to_string(self, other: bytes | str) -> str:
234232

235233

236234
class DNSAddress(DNSRecord):
237-
"""A DNS address record"""
238-
239235
__slots__ = ("_hash", "address", "scope_id")
240236

241237
def __init__(
@@ -342,8 +338,6 @@ def __repr__(self) -> str:
342338

343339

344340
class DNSPointer(DNSRecord):
345-
"""A DNS pointer record"""
346-
347341
__slots__ = ("_hash", "alias", "alias_key")
348342

349343
def __init__(
@@ -395,8 +389,6 @@ def __repr__(self) -> str:
395389

396390

397391
class DNSText(DNSRecord):
398-
"""A DNS text record"""
399-
400392
__slots__ = ("_hash", "text")
401393

402394
def __init__(
@@ -439,8 +431,6 @@ def __repr__(self) -> str:
439431

440432

441433
class DNSService(DNSRecord):
442-
"""A DNS service record"""
443-
444434
__slots__ = ("_hash", "port", "priority", "server", "server_key", "weight")
445435

446436
def __init__(

‎tests/services/test_browser.py‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ def test_first_query_delay():
524524
first_query_time = None
525525

526526
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
527-
"""Sends an outgoing packet."""
528527
nonlocal first_query_time
529528
if first_query_time is None:
530529
first_query_time = current_time_millis()
@@ -578,7 +577,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
578577
questions: list[list[DNSQuestion]] = []
579578

580579
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
581-
"""Sends an outgoing packet."""
582580
pout = r.DNSIncoming(out.packets()[0])
583581
questions.append(pout.questions)
584582
got_query.set()
@@ -680,7 +678,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
680678
packets = []
681679

682680
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
683-
"""Sends an outgoing packet."""
684681
pout = r.DNSIncoming(out.packets()[0])
685682
packets.append(pout)
686683
got_query.set()
@@ -773,7 +770,6 @@ async def test_asking_qm_questions():
773770
first_outgoing = None
774771

775772
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
776-
"""Sends an outgoing packet."""
777773
nonlocal first_outgoing
778774
if first_outgoing is None:
779775
first_outgoing = out
@@ -813,7 +809,6 @@ async def test_asking_qu_questions():
813809
first_outgoing = None
814810

815811
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
816-
"""Sends an outgoing packet."""
817812
nonlocal first_outgoing
818813
if first_outgoing is None:
819814
first_outgoing = out
@@ -1257,7 +1252,6 @@ async def test_query_scheduler():
12571252
sends: list[r.DNSIncoming] = []
12581253

12591254
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
1260-
"""Sends an outgoing packet."""
12611255
pout = r.DNSIncoming(out.packets()[0])
12621256
sends.append(pout)
12631257

@@ -1350,7 +1344,6 @@ async def test_query_scheduler_rescue_records():
13501344
sends: list[r.DNSIncoming] = []
13511345

13521346
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
1353-
"""Sends an outgoing packet."""
13541347
pout = r.DNSIncoming(out.packets()[0])
13551348
sends.append(pout)
13561349

@@ -1664,7 +1657,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
16641657
sends: list[r.DNSIncoming] = []
16651658

16661659
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
1667-
"""Sends an outgoing packet."""
16681660
pout = r.DNSIncoming(out.packets()[0])
16691661
sends.append(pout)
16701662

@@ -1732,7 +1724,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
17321724
sends: list[r.DNSIncoming] = []
17331725

17341726
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
1735-
"""Sends an outgoing packet."""
17361727
pout = r.DNSIncoming(out.packets()[0])
17371728
sends.append(pout)
17381729

‎tests/services/test_info.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ def test_get_info_partial(self):
273273
last_sent: r.DNSOutgoing | None = None
274274

275275
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
276-
"""Sends an outgoing packet."""
277276
nonlocal last_sent
278277

279278
last_sent = out
@@ -413,7 +412,6 @@ def test_get_info_suppressed_by_question_history(self):
413412
last_sent: r.DNSOutgoing | None = None
414413

415414
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
416-
"""Sends an outgoing packet."""
417415
nonlocal last_sent
418416

419417
last_sent = out
@@ -1254,7 +1252,6 @@ def test_asking_qu_questions(quick_request_timing):
12541252
first_outgoing = None
12551253

12561254
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
1257-
"""Sends an outgoing packet."""
12581255
nonlocal first_outgoing
12591256
if first_outgoing is None:
12601257
first_outgoing = out
@@ -1280,7 +1277,6 @@ def test_asking_qm_questions(quick_request_timing):
12801277
first_outgoing = None
12811278

12821279
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
1283-
"""Sends an outgoing packet."""
12841280
nonlocal first_outgoing
12851281
if first_outgoing is None:
12861282
first_outgoing = out
@@ -1317,7 +1313,6 @@ async def test_we_try_four_times_with_random_delay():
13171313
request_count = 0
13181314

13191315
def async_send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
1320-
"""Sends an outgoing packet."""
13211316
nonlocal request_count
13221317
request_count += 1
13231318

@@ -2161,7 +2156,6 @@ async def test_unicast_flag_if_requested() -> None:
21612156
aiozc = AsyncZeroconf(interfaces=["127.0.0.1"])
21622157

21632158
def async_send(out: DNSOutgoing, addr: str | None = None, port: int = const._MDNS_PORT) -> None:
2164-
"""Sends an outgoing packet."""
21652159
for question in out.questions:
21662160
assert question.unicast
21672161

‎tests/test_asyncio.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
10271027
packets = []
10281028

10291029
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT, v6_flow_scope=()):
1030-
"""Sends an outgoing packet."""
10311030
pout = DNSIncoming(out.packets()[0])
10321031
packets.append(pout)
10331032
last_answers = pout.answers()
@@ -1191,7 +1190,6 @@ async def test_info_asking_default_is_asking_qm_questions_after_the_first_qu(qui
11911190
second_outgoing = None
11921191

11931192
def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
1194-
"""Sends an outgoing packet."""
11951193
nonlocal first_outgoing
11961194
nonlocal second_outgoing
11971195
if out.questions:

‎tests/test_handlers.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def get_ttl(record_type):
7272
return const._DNS_OTHER_TTL
7373

7474
def _process_outgoing_packet(out):
75-
"""Sends an outgoing packet."""
7675
nonlocal nbr_answers, nbr_additionals, nbr_authorities
7776

7877
for answer, _ in out.answers:

‎tests/test_init.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ def teardown_module():
2929

3030

3131
class Names(unittest.TestCase):
32-
def test_long_name(self):
33-
generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE)
34-
question = r.DNSQuestion(
35-
"this.is.a.very.long.name.with.lots.of.parts.in.it.local.",
36-
const._TYPE_SRV,
37-
const._CLASS_IN,
38-
)
39-
generated.add_question(question)
40-
r.DNSIncoming(generated.packets()[0])
41-
4232
def test_exceedingly_long_name(self):
4333
generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE)
4434
name = f"{'part.' * 1000}local."

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL