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

revert: remove short prose found by the character level audit by bdraco · Pull Request #1852 · python-zeroconf/python-zeroconf · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (6) .yml  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.ref }}

- name: Create local branch name
env:
- env:
BRANCH: ${{ github.head_ref || github.ref_name }}
run: git switch -C "$BRANCH"

Expand Down Expand Up @@ -222,8 +221,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.ref }}

- name: Create local branch name
env:
- env:
BRANCH: ${{ github.ref_name }}
run: git switch -C "$BRANCH"

Expand Down
10 changes: 0 additions & 10 deletions src/zeroconf/_dns.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ def entry_to_string(self, hdr: str, other: bytes | str | None) -> str:


class DNSQuestion(DNSEntry):
"""A DNS question entry"""

__slots__ = ("_hash",)

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


class DNSAddress(DNSRecord):
"""A DNS address record"""

__slots__ = ("_hash", "address", "scope_id")

def __init__(
Expand Down Expand Up @@ -342,8 +338,6 @@ def __repr__(self) -> str:


class DNSPointer(DNSRecord):
"""A DNS pointer record"""

__slots__ = ("_hash", "alias", "alias_key")

def __init__(
Expand Down Expand Up @@ -395,8 +389,6 @@ def __repr__(self) -> str:


class DNSText(DNSRecord):
"""A DNS text record"""

__slots__ = ("_hash", "text")

def __init__(
Expand Down Expand Up @@ -439,8 +431,6 @@ def __repr__(self) -> str:


class DNSService(DNSRecord):
"""A DNS service record"""

__slots__ = ("_hash", "port", "priority", "server", "server_key", "weight")

def __init__(
Expand Down
9 changes: 0 additions & 9 deletions tests/services/test_browser.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ def test_first_query_delay():
first_query_time = None

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

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

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

def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
"""Sends an outgoing packet."""
nonlocal first_outgoing
if first_outgoing is None:
first_outgoing = out
Expand Down Expand Up @@ -813,7 +809,6 @@ async def test_asking_qu_questions():
first_outgoing = None

def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
"""Sends an outgoing packet."""
nonlocal first_outgoing
if first_outgoing is None:
first_outgoing = out
Expand Down Expand Up @@ -1257,7 +1252,6 @@ async def test_query_scheduler():
sends: list[r.DNSIncoming] = []

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

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

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

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

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

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

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

Expand Down
6 changes: 0 additions & 6 deletions tests/services/test_info.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def test_get_info_partial(self):
last_sent: r.DNSOutgoing | None = None

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

last_sent = out
Expand Down Expand Up @@ -413,7 +412,6 @@ def test_get_info_suppressed_by_question_history(self):
last_sent: r.DNSOutgoing | None = None

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

last_sent = out
Expand Down Expand Up @@ -1254,7 +1252,6 @@ def test_asking_qu_questions(quick_request_timing):
first_outgoing = None

def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
"""Sends an outgoing packet."""
nonlocal first_outgoing
if first_outgoing is None:
first_outgoing = out
Expand All @@ -1280,7 +1277,6 @@ def test_asking_qm_questions(quick_request_timing):
first_outgoing = None

def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
"""Sends an outgoing packet."""
nonlocal first_outgoing
if first_outgoing is None:
first_outgoing = out
Expand Down Expand Up @@ -1317,7 +1313,6 @@ async def test_we_try_four_times_with_random_delay():
request_count = 0

def async_send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
"""Sends an outgoing packet."""
nonlocal request_count
request_count += 1

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

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

Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,6 @@ def on_service_state_change(zeroconf, service_type, state_change, name):
packets = []

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

def send(out, addr=const._MDNS_ADDR, port=const._MDNS_PORT):
"""Sends an outgoing packet."""
nonlocal first_outgoing
nonlocal second_outgoing
if out.questions:
Expand Down
1 change: 0 additions & 1 deletion tests/test_handlers.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def get_ttl(record_type):
return const._DNS_OTHER_TTL

def _process_outgoing_packet(out):
"""Sends an outgoing packet."""
nonlocal nbr_answers, nbr_additionals, nbr_authorities

for answer, _ in out.answers:
Expand Down
10 changes: 0 additions & 10 deletions tests/test_init.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ def teardown_module():


class Names(unittest.TestCase):
def test_long_name(self):
generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE)
question = r.DNSQuestion(
"this.is.a.very.long.name.with.lots.of.parts.in.it.local.",
const._TYPE_SRV,
const._CLASS_IN,
)
generated.add_question(question)
r.DNSIncoming(generated.packets()[0])

def test_exceedingly_long_name(self):
generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE)
name = f"{'part.' * 1000}local."
Expand Down
Loading

Back | FazBrowse Home | New Git URL