Skip to content

Commit c371dcc

Browse files
committed
refactoring asyncio_dgram
1 parent 113cff8 commit c371dcc

File tree

5 files changed

+32
-31
lines changed

5 files changed

+32
-31
lines changed

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ packages = find:
5858
include_package_data = True
5959
python_requires = >=3.6, <4
6060

61+
[options.packages.find]
62+
where = src
63+
6164
[options.extras_require]
6265
with_crypto = cryptography >= 39.0.0
6366
with_takproto = takproto >= 2.0.0

src/pytak/asyncio_dgram/aio.py renamed to src/pytak/asyncio_dgram.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# MIT License
2+
#
3+
# Copyright (c) 2019 Justin Bronder
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
123
import sys
224
import asyncio
325
import pathlib

src/pytak/asyncio_dgram/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/pytak/asyncio_dgram/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/test_client_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ async def test_protocol_factory_udp():
4949
test_url1: str = "udp://localhost"
5050
config: dict = {"COT_URL": test_url1}
5151
reader, writer = await pytak.protocol_factory(config)
52-
assert isinstance(reader, pytak.asyncio_dgram.aio.DatagramServer)
53-
assert isinstance(writer, pytak.asyncio_dgram.aio.DatagramClient)
52+
assert isinstance(reader, pytak.asyncio_dgram.DatagramServer)
53+
assert isinstance(writer, pytak.asyncio_dgram.DatagramClient)
5454

5555

5656
@pytest.mark.asyncio
@@ -116,8 +116,8 @@ async def test_protocol_factory_udp_broadcast():
116116
test_url1: str = "udp+broadcast://localhost:6666"
117117
config: dict = {"COT_URL": test_url1}
118118
reader, writer = await pytak.protocol_factory(config)
119-
assert isinstance(reader, pytak.asyncio_dgram.aio.DatagramServer)
120-
assert isinstance(writer, pytak.asyncio_dgram.aio.DatagramClient)
119+
assert isinstance(reader, pytak.asyncio_dgram.DatagramServer)
120+
assert isinstance(writer, pytak.asyncio_dgram.DatagramClient)
121121

122122

123123
@pytest.mark.asyncio
@@ -126,8 +126,8 @@ async def test_protocol_factory_udp_multicast():
126126
test_url1: str = "udp://239.2.3.1"
127127
config: dict = {"COT_URL": test_url1}
128128
reader, writer = await pytak.protocol_factory(config)
129-
assert isinstance(reader, pytak.asyncio_dgram.aio.DatagramServer)
130-
assert isinstance(writer, pytak.asyncio_dgram.aio.DatagramClient)
129+
assert isinstance(reader, pytak.asyncio_dgram.DatagramServer)
130+
assert isinstance(writer, pytak.asyncio_dgram.DatagramClient)
131131

132132

133133
@pytest.mark.asyncio
@@ -137,7 +137,7 @@ async def test_protocol_factory_udp_multicast_wo():
137137
config: dict = {"COT_URL": test_url1}
138138
reader, writer = await pytak.protocol_factory(config)
139139
assert reader == None
140-
assert isinstance(writer, pytak.asyncio_dgram.aio.DatagramClient)
140+
assert isinstance(writer, pytak.asyncio_dgram.DatagramClient)
141141

142142

143143
@pytest.mark.asyncio

0 commit comments

Comments
 (0)