mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
Stable integration test deleting many messages using UID EXPUNGE
This commit is contained in:
@ -32,7 +32,10 @@ Feature: IMAP remove messages from mailbox
|
|||||||
And there is IMAP client selected in "<mailbox>"
|
And there is IMAP client selected in "<mailbox>"
|
||||||
When IMAP client marks message seq "1:*" as deleted
|
When IMAP client marks message seq "1:*" as deleted
|
||||||
Then IMAP response is "OK"
|
Then IMAP response is "OK"
|
||||||
When IMAP client sends expunge
|
# Use UID version to not be sensitive about the order from API. Event loop
|
||||||
|
# could return it in different order and delete first message with seq 1,
|
||||||
|
# which would produce EXPUNGE sequence as 1 4 3 2 1, for example.
|
||||||
|
When IMAP client sends expunge by UID "1:5"
|
||||||
Then IMAP response is "OK"
|
Then IMAP response is "OK"
|
||||||
And IMAP response contains "\* 1 EXPUNGE"
|
And IMAP response contains "\* 1 EXPUNGE"
|
||||||
And IMAP response contains "\* 2 EXPUNGE"
|
And IMAP response contains "\* 2 EXPUNGE"
|
||||||
|
|||||||
@ -58,6 +58,8 @@ func IMAPActionsMessagesFeatureContext(s *godog.Suite) {
|
|||||||
s.Step(`^IMAP client "([^"]*)" starts IDLE-ing$`, imapClientNamedStartsIDLEing)
|
s.Step(`^IMAP client "([^"]*)" starts IDLE-ing$`, imapClientNamedStartsIDLEing)
|
||||||
s.Step(`^IMAP client sends expunge$`, imapClientExpunge)
|
s.Step(`^IMAP client sends expunge$`, imapClientExpunge)
|
||||||
s.Step(`^IMAP client "([^"]*)" sends expunge$`, imapClientNamedExpunge)
|
s.Step(`^IMAP client "([^"]*)" sends expunge$`, imapClientNamedExpunge)
|
||||||
|
s.Step(`^IMAP client sends expunge by UID "([^"]*)"$`, imapClientExpungeByUID)
|
||||||
|
s.Step(`^IMAP client "([^"]*)" sends expunge by UID "([^"]*)"$`, imapClientNamedExpungeByUID)
|
||||||
s.Step(`^IMAP client sends ID with argument:$`, imapClientSendsID)
|
s.Step(`^IMAP client sends ID with argument:$`, imapClientSendsID)
|
||||||
s.Step(`^IMAP client "([^"]*)" sends ID with argument:$`, imapClientNamedSendsID)
|
s.Step(`^IMAP client "([^"]*)" sends ID with argument:$`, imapClientNamedSendsID)
|
||||||
}
|
}
|
||||||
@ -287,6 +289,16 @@ func imapClientNamedExpunge(imapClient string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func imapClientExpungeByUID(uids string) error {
|
||||||
|
return imapClientNamedExpungeByUID("imap", uids)
|
||||||
|
}
|
||||||
|
|
||||||
|
func imapClientNamedExpungeByUID(imapClient, uids string) error {
|
||||||
|
res := ctx.GetIMAPClient(imapClient).ExpungeUID(uids)
|
||||||
|
ctx.SetIMAPLastResponse(imapClient, res)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func imapClientSendsID(data *gherkin.DocString) error {
|
func imapClientSendsID(data *gherkin.DocString) error {
|
||||||
return imapClientNamedSendsID("imap", data)
|
return imapClientNamedSendsID("imap", data)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -246,6 +246,10 @@ func (c *IMAPClient) Expunge() *IMAPResponse {
|
|||||||
return c.SendCommand("EXPUNGE")
|
return c.SendCommand("EXPUNGE")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *IMAPClient) ExpungeUID(ids string) *IMAPResponse {
|
||||||
|
return c.SendCommand(fmt.Sprintf("UID EXPUNGE %s", ids))
|
||||||
|
}
|
||||||
|
|
||||||
// Extennsions
|
// Extennsions
|
||||||
// Extennsions: IDLE
|
// Extennsions: IDLE
|
||||||
|
|
||||||
|
|||||||
@ -12,3 +12,4 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* GODT-885 Do not explicitly unlabel folders during move to match behaviour of other clients.
|
* GODT-885 Do not explicitly unlabel folders during move to match behaviour of other clients.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
* GODT-1011 Stable integration test deleting many messages using UID EXPUNGE.
|
||||||
|
|||||||
Reference in New Issue
Block a user