Skip to content

Commit 6a6b330

Browse files
committed
Test updates
1 parent c415e62 commit 6a6b330

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/daf/message/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ def __init__(self,
127127
self._created_at = datetime.now()
128128
self._data = data
129129
self._fbcdata = isinstance(data, _FunctionBaseCLASS)
130+
self._deleted = False
130131
# Attributes created with this function will not be re-referenced to a different object
131132
# if the function is called again, ensuring safety (.update_method)
132133
misc._write_attr_once(self, "update_semaphore", asyncio.Semaphore(1))
133134
# For comparing copies of the object (prevents .update from overwriting)
134-
misc._write_attr_once(self, "_id", id(self))
135+
misc._write_attr_once(self, "_id", id(self))
135136

136137
def __repr__(self) -> str:
137138
return f"{type(self).__name__}(data={self._data})"

testing/test_autogen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def test_autoguild(guilds, accounts):
3030
assert guild_exclude not in found, "AutoGUILD included the guild that matches exclude pattern."
3131
finally:
3232
if auto_guild is not None:
33-
daf.remove_object(auto_guild)
33+
await daf.remove_object(auto_guild)
3434

3535
@pytest.mark.asyncio
3636
async def test_autochannel(guilds, channels, accounts):
@@ -77,7 +77,7 @@ async def test_autochannel(guilds, channels, accounts):
7777
await auto_channel2.update()
7878
finally:
7979
if daf_guild is not None:
80-
daf.remove_object(daf_guild)
80+
await daf.remove_object(daf_guild)
8181

8282

8383

testing/test_period_dynamic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ async def dynamic_getter_async(items: list):
105105

106106
finally:
107107
with suppress(ValueError):
108-
daf.remove_object(guild)
108+
await daf.remove_object(guild)
109109
with suppress(ValueError):
110-
daf.remove_object(user)
110+
await daf.remove_object(user)
111111

112112

113113
@pytest.mark.asyncio
@@ -153,4 +153,4 @@ def dynamic_getter(items: list):
153153

154154
finally:
155155
with suppress(ValueError):
156-
daf.remove_object(guild)
156+
await daf.remove_object(guild)

testing/test_send_normal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async def test_text_message_send(channels: Tuple[daf.discord.ChannelType], guild
4747
assert len(result["channels"]["failed"]) == 0, "Failed to send to all channels"
4848

4949
# DirectMESSAGE send
50-
result = await direct_message._send()
50+
result, _panic = await direct_message._send()
5151
sent_data_result = result["sent_data"]
5252

5353
# Check results

testing/test_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def test_text_message_update(channels, guilds, accounts):
4949

5050
# DirectMESSAGE send
5151
await direct_message.update(data=data)
52-
result = await direct_message._send()
52+
result, _panic = await direct_message._send()
5353
print(direct_message)
5454

5555
# Check results

0 commit comments

Comments
 (0)