@@ -81,17 +81,23 @@ def test_generic_autocomplete_no_prefix(self, mocker, write_box, text,
81
81
@pytest .mark .parametrize ('text, state, footer_text' , [
82
82
# no-text mentions
83
83
('@' , 0 ,
84
- ['Human Myself' , 'Human 1' , 'Human 2' ,
85
- 'Group 1' , 'Group 2' , 'Group 3' , 'Group 4' ]),
84
+ ['Human Myself' , 'Human 1' , 'Human 2' , 'Human Duplicate' ,
85
+ 'Human Duplicate' , ' Group 1' , 'Group 2' , 'Group 3' , 'Group 4' ]),
86
86
('@*' , 0 , ['Group 1' , 'Group 2' , 'Group 3' , 'Group 4' ]),
87
- ('@**' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ]),
87
+ ('@**' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ,
88
+ 'Human Duplicate' , 'Human Duplicate' ]),
88
89
# mentions
89
- ('@Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ]),
90
- ('@**Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ]),
91
- ('@_Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ]),
90
+ ('@Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ,
91
+ 'Human Duplicate' , 'Human Duplicate' ]),
92
+ ('@**Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ,
93
+ 'Human Duplicate' , 'Human Duplicate' ]),
94
+ ('@_Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ,
95
+ 'Human Duplicate' , 'Human Duplicate' ]),
92
96
('@_*Human' , None , []), # NOTE: Optional single star fails
93
- ('@_**Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ]),
94
- ('@Human' , None , ['Human Myself' , 'Human 1' , 'Human 2' ]),
97
+ ('@_**Human' , 0 , ['Human Myself' , 'Human 1' , 'Human 2' ,
98
+ 'Human Duplicate' , 'Human Duplicate' ]),
99
+ ('@Human' , None , ['Human Myself' , 'Human 1' , 'Human 2' ,
100
+ 'Human Duplicate' , 'Human Duplicate' ]),
95
101
('@NoMatch' , None , []),
96
102
# streams
97
103
('#Stream' , 0 , ['Stream 1' , 'Stream 2' , 'Secret stream' ,
@@ -122,13 +128,19 @@ def test_generic_autocomplete_set_footer(self, mocker, write_box,
122
128
('@Human' , 0 , '@**Human Myself**' ),
123
129
('@Human' , 1 , '@**Human 1**' ),
124
130
('@Human' , 2 , '@**Human 2**' ),
125
- ('@Human' , - 1 , '@**Human 2**' ),
126
- ('@Human' , - 2 , '@**Human 1**' ),
127
- ('@Human' , - 3 , '@**Human Myself**' ),
128
- ('@Human' , - 4 , None ),
131
+ ('@Human' , 3 , '@**Human Duplicate**' ),
132
+ ('@Human' , 4 , '@**Human Duplicate**' ),
133
+ ('@Human' , - 1 , '@**Human Duplicate**' ),
134
+ ('@Human' , - 2 , '@**Human Duplicate**' ),
135
+ ('@Human' , - 3 , '@**Human 2**' ),
136
+ ('@Human' , - 4 , '@**Human 1**' ),
137
+ ('@Human' , - 5 , '@**Human Myself**' ),
138
+ ('@Human' , - 6 , None ),
129
139
('@_Human' , 0 , '@_**Human Myself**' ),
130
140
('@_Human' , 1 , '@_**Human 1**' ),
131
141
('@_Human' , 2 , '@_**Human 2**' ),
142
+ ('@_Human' , 3 , '@_**Human Duplicate**' ),
143
+ ('@_Human' , 4 , '@_**Human Duplicate**' ),
132
144
('@H' , 1 , '@**Human 1**' ),
133
145
('@Hu' , 1 , '@**Human 1**' ),
134
146
('@Hum' , 1 , '@**Human 1**' ),
@@ -155,18 +167,22 @@ def test_generic_autocomplete_set_footer(self, mocker, write_box,
155
167
('@' , 0 , '@**Human Myself**' ),
156
168
('@' , 1 , '@**Human 1**' ),
157
169
('@' , 2 , '@**Human 2**' ),
158
- ('@' , 3 , '@*Group 1*' ),
159
- ('@' , 4 , '@*Group 2*' ),
160
- ('@' , 5 , '@*Group 3*' ),
161
- ('@' , 6 , '@*Group 4*' ),
162
- ('@' , 7 , None ), # Reached last match
163
- ('@' , 8 , None ), # Beyond end
170
+ ('@' , 3 , '@**Human Duplicate**' ),
171
+ ('@' , 4 , '@**Human Duplicate**' ),
172
+ ('@' , 5 , '@*Group 1*' ),
173
+ ('@' , 6 , '@*Group 2*' ),
174
+ ('@' , 7 , '@*Group 3*' ),
175
+ ('@' , 8 , '@*Group 4*' ),
176
+ ('@' , 9 , None ), # Reached last match
177
+ ('@' , 10 , None ), # Beyond end
164
178
# Expected sequence of autocompletes from '@**' (no groups)
165
179
('@**' , 0 , '@**Human Myself**' ),
166
180
('@**' , 1 , '@**Human 1**' ),
167
181
('@**' , 2 , '@**Human 2**' ),
168
- ('@**' , 3 , None ), # Reached last match
169
- ('@**' , 4 , None ), # Beyond end
182
+ ('@' , 3 , '@**Human Duplicate**' ),
183
+ ('@' , 4 , '@**Human Duplicate**' ),
184
+ ('@**' , 5 , None ), # Reached last match
185
+ ('@**' , 6 , None ), # Beyond end
170
186
# Expected sequence of autocompletes from '@*' (only groups)
171
187
('@*' , 0 , '@*Group 1*' ),
172
188
('@*' , 1 , '@*Group 2*' ),
@@ -178,9 +194,11 @@ def test_generic_autocomplete_set_footer(self, mocker, write_box,
178
194
('@_' , 0 , '@_**Human Myself**' ), # NOTE: No silent group mention
179
195
('@_' , 1 , '@_**Human 1**' ),
180
196
('@_' , 2 , '@_**Human 2**' ),
181
- ('@_' , 3 , None ), # Reached last match
182
- ('@_' , 4 , None ), # Beyond end
183
- ('@_' , - 1 , '@_**Human 2**' ),
197
+ ('@_' , 3 , '@_**Human Duplicate**' ),
198
+ ('@_' , 4 , '@_**Human Duplicate**' ),
199
+ ('@_' , 5 , None ), # Reached last match
200
+ ('@_' , 6 , None ), # Beyond end
201
+ ('@_' , - 1 , '@_**Human Duplicate**' ),
184
202
# Complex autocomplete prefixes.
185
203
('(@H' , 0 , '(@**Human Myself**' ),
186
204
('(@H' , 1 , '(@**Human 1**' ),
@@ -319,11 +337,15 @@ def test_generic_autocomplete_emojis(self, write_box, text,
319
337
('' , [
320
338
'Human Myself' ,
321
339
'Human 1' ,
322
- 'Human 2'
340
+ 'Human 2' ,
341
+ 'Human Duplicate' ,
342
+ 'Human Duplicate' ,
323
343
], [
324
344
'Human Myself <[email protected] >' ,
325
345
326
-
346
+
347
+ 'Human Duplicate <[email protected] >' ,
348
+ 'Human Duplicate <[email protected] >' ,
327
349
]),
328
350
('My' , ['Human Myself' ],
329
351
['Human Myself <[email protected] >' ]),
@@ -365,14 +387,20 @@ def test__to_box_autocomplete_with_spaces(self, write_box, text,
365
387
('Welcome Bot <[email protected] >, Human' , [
366
388
'Human Myself' ,
367
389
'Human 1' ,
368
- 'Human 2'
390
+ 'Human 2' ,
391
+ 'Human Duplicate' ,
392
+ 'Human Duplicate' ,
369
393
], [
370
394
'Welcome Bot <[email protected] >, '
371
395
'Human Myself <[email protected] >' ,
372
396
'Welcome Bot <[email protected] >, '
373
397
374
398
'Welcome Bot <[email protected] >, '
375
-
399
+
400
+ 'Welcome Bot <[email protected] >, '
401
+ 'Human Duplicate <[email protected] >' ,
402
+ 'Welcome Bot <[email protected] >, '
403
+ 'Human Duplicate <[email protected] >' ,
376
404
]),
377
405
('Welcome Bot <[email protected] >, Notification Bot '
378
406
@@ -382,14 +410,20 @@ def test__to_box_autocomplete_with_spaces(self, write_box, text,
382
410
('Email Gateway <[email protected] >,Human' , [
383
411
'Human Myself' ,
384
412
'Human 1' ,
385
- 'Human 2'
413
+ 'Human 2' ,
414
+ 'Human Duplicate' ,
415
+ 'Human Duplicate' ,
386
416
], [
387
417
'Email Gateway <[email protected] >, '
388
418
'Human Myself <[email protected] >' ,
389
419
'Email Gateway <[email protected] >, '
390
420
391
421
'Email Gateway <[email protected] >, '
392
-
422
+
423
+ 'Email Gateway <[email protected] >, '
424
+ 'Human Duplicate <[email protected] >' ,
425
+ 'Email Gateway <[email protected] >, '
426
+ 'Human Duplicate <[email protected] >' ,
393
427
]),
394
428
('Human 1 <[email protected] >, Notification Bot '
395
429
0 commit comments