@@ -739,15 +739,26 @@ def test_fetch_modifiers(self):
739
739
self .client .close_folder ()
740
740
self .clear_folder (self .base_folder )
741
741
742
+ #
742
743
# Actual testing starts here
743
- maxModSeq = self .client .select_folder (self .base_folder )[b'HIGHESTMODSEQ' ]
744
+ #
745
+
746
+ # Get the starting MODSEQ
747
+ modseq = self .client .select_folder (self .base_folder )[b'HIGHESTMODSEQ' ]
748
+
749
+ # Add a message so that the MODSEQ gets bumped
744
750
self .append_msg (SIMPLE_MESSAGE )
745
751
msg_id = self .client .search ()[0 ]
746
- resp = self .client .fetch (msg_id , ['FLAGS' ], ['CHANGEDSINCE %d' % maxModSeq ])
747
- self .assertIn (b'MODSEQ' , resp [msg_id ])
748
752
749
- # Prove that the modifier is actually being used
750
- resp = self .client .fetch (msg_id , ['FLAGS' ], ['CHANGEDSINCE %d' % (maxModSeq + 1 )])
753
+ # Request changes since the starting MODSEQ: this should
754
+ # return the new message.
755
+ resp = self .client .fetch (msg_id , ['FLAGS' ], ['CHANGEDSINCE %d' % modseq ])
756
+ new_modseq = resp [msg_id ][b"MODSEQ" ][0 ]
757
+ self .assertGreater (new_modseq , modseq )
758
+
759
+ # Now asked for changes since the MODSEQ on the added
760
+ # message. These shouldn't be any.
761
+ resp = self .client .fetch (msg_id , ['FLAGS' ], ['CHANGEDSINCE %d' % new_modseq ])
751
762
self .assertEqual (resp , {})
752
763
753
764
def test_BODYSTRUCTURE (self ):
0 commit comments