@@ -32,11 +32,11 @@ class TestQuotePlugin:
32
32
pytest .mark .bot (config = """
33
33
["@bot"]
34
34
plugins = ["mongodb", "usertrack", "auth", "quote"]
35
-
35
+
36
36
[auth]
37
37
nickaccount = "#First:quote"
38
38
otheraccount = "#Second:quote"
39
-
39
+
40
40
[mongodb]
41
41
mode = "mock"
42
42
""" ),
@@ -96,7 +96,7 @@ async def test_client_quote_add_pattern_find(self):
96
96
97
97
async def test_client_quotes_not_exist (self ):
98
98
await self ._recv_privmsg ('Nick!~user@host' , '#First' , '!quote Nick' )
99
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #First' , ' No data for Nick') )
99
+ self .bot_helper .assert_sent ('NOTICE #First : No data for Nick' )
100
100
101
101
async def test_client_quote_add_multi (self ):
102
102
await self ._recv_privmsg ('Nick!~user@host' , '#First' , 'test data' )
@@ -110,10 +110,10 @@ async def test_client_quote_channel_specific_logs(self):
110
110
await self ._recv_privmsg ('Nick!~user@host' , '#First' , 'other data' )
111
111
112
112
await self ._recv_privmsg ('Other!~user@host' , '#Second' , '!remember Nick' )
113
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #Second' , ' No data for Nick') )
113
+ self .bot_helper .assert_sent ('NOTICE #Second : No data for Nick' )
114
114
115
115
await self ._recv_privmsg ('Other!~user@host' , '#Second' , '!quote Nick' )
116
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #Second' , ' No data for Nick') )
116
+ self .bot_helper .assert_sent ('NOTICE #Second : No data for Nick' )
117
117
118
118
async def test_client_quote_channel_specific_quotes (self ):
119
119
await self ._recv_privmsg ('Nick!~user@host' , '#First' , 'test data' )
@@ -129,8 +129,8 @@ async def test_client_quote_channel_specific_quotes(self):
129
129
130
130
async def test_client_quote_channel_fill_logs (self ):
131
131
for i in range (150 ):
132
- await self ._recv_privmsg ('Nick!~user@host' , '#First' , 'test data#{}' . format ( i ) )
133
- await self ._recv_privmsg ('Nick!~user@host' , '#Second' , 'other data#{}' . format ( i ) )
132
+ await self ._recv_privmsg ('Nick!~user@host' , '#First' , f 'test data#{ i } ' )
133
+ await self ._recv_privmsg ('Nick!~user@host' , '#Second' , f 'other data#{ i } ' )
134
134
135
135
await self ._recv_privmsg ('Other!~user@host' , '#Second' , '!remember Nick data#135' )
136
136
await self ._recv_privmsg ('Other!~user@host' , '#Second' , '!quote Nick' )
@@ -154,7 +154,7 @@ async def test_client_quotes_list(self):
154
154
await self ._recv_line (":Other!~other@otherhost ACCOUNT otheraccount" )
155
155
156
156
# stick some quotes in a thing
157
- data = ['test data#{}' . format ( i ) for i in range (10 )]
157
+ data = [f 'test data#{ i } ' for i in range (10 )]
158
158
for msg in data :
159
159
await self ._recv_privmsg ('Nick!~user@host' , '#Second' , msg )
160
160
await self ._recv_privmsg ('Other!~user@host' , '#Second' , '!remember Nick' )
@@ -187,7 +187,7 @@ async def test_client_quote_remove(self):
187
187
await self ._recv_privmsg ('Nick!~user@host' , '#First' , '!quote.remove 0' )
188
188
189
189
await self ._recv_privmsg ('Nick!~user@host' , '#First' , '!quote Nick' )
190
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #First' , ' No data for Nick') )
190
+ self .bot_helper .assert_sent ('NOTICE #First : No data for Nick' )
191
191
192
192
async def test_client_quote_remove_no_permission (self ):
193
193
await self ._recv_line (":Other!~other@otherhost ACCOUNT otheraccount" )
@@ -196,13 +196,13 @@ async def test_client_quote_remove_no_permission(self):
196
196
await self ._recv_privmsg ('Other!~user@host' , '#First' , '!remember Nick' )
197
197
await self ._recv_privmsg ('Other!~user@host' , '#First' , '!quote.remove -1' )
198
198
199
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #First' , ' error: otheraccount not authorised for #First:quote') )
199
+ self .bot_helper .assert_sent ('NOTICE #First : error: otheraccount not authorised for #First:quote' )
200
200
201
201
async def test_client_quote_remove_no_quotes (self ):
202
202
await self ._recv_line (":Nick!~user@host ACCOUNT nickaccount" )
203
203
await self ._recv_privmsg ('Nick!~user@host' , '#First' , '!quote.remove -1' )
204
204
205
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #First' , ' Error: could not remove quote(s) with ID: -1') )
205
+ self .bot_helper .assert_sent ('NOTICE #First : Error: could not remove quote(s) with ID: -1' )
206
206
207
207
async def test_client_quote_list_no_permission (self ):
208
208
await self ._recv_line (":Other!~other@otherhost ACCOUNT otheraccount" )
@@ -211,7 +211,7 @@ async def test_client_quote_list_no_permission(self):
211
211
await self ._recv_privmsg ('Other!~user@host' , '#First' , '!remember Nick' )
212
212
await self ._recv_privmsg ('Other!~user@host' , '#First' , '!quote.list' )
213
213
214
- self .bot_helper .assert_sent ('NOTICE {} :{}' . format ( ' #First' , ' error: otheraccount not authorised for #First:quote') )
214
+ self .bot_helper .assert_sent ('NOTICE #First : error: otheraccount not authorised for #First:quote' )
215
215
216
216
async def test_client_quote_channelwide (self ):
217
217
await self ._recv_privmsg ('Nick!~user@host' , '#First' , 'test data!' )
0 commit comments