From: Manni H. <man...@us...> - 2007-11-24 16:28:07
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8873/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: Add more IMAP tests Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.8 retrieving revision 1.3.4.9 diff -C2 -d -r1.3.4.8 -r1.3.4.9 *** TestIMAP.tst 23 Nov 2007 11:08:43 -0000 1.3.4.8 --- TestIMAP.tst 24 Nov 2007 16:15:22 -0000 1.3.4.9 *************** *** 25,34 **** # TODO: # IMAP.pm: - # * changed uidvalidity while connecting # * fail while statusing # * duplicate hash value => duplicate message in inbox # * fail while fetching a part # * fail while fetching_header_fields - # * validate_item # # Client.pm --- 25,32 ---- *************** *** 142,146 **** test_assert( -e 'imap.spool/other/1' ); ! # move msgs 1, 2, and 3 to folder presonal $client = $im->{folders__}{'spam'}{imap}; test_assert( $client ); --- 140,151 ---- test_assert( -e 'imap.spool/other/1' ); ! # The module should not allow reclassification to the same ! # bucket. ! my $hash = ( $h->get_slot_fields( 1 ) )[6]; ! test_assert( ! $im->can_reclassify__( $hash, 'spam' ) ); ! # If the hash is unknown, it should reclassify either ! test_assert( ! $im->can_reclassify__( 'hash', 'other' ) ); ! ! # move msgs 1, 2, and 3 to folder personal $client = $im->{folders__}{'spam'}{imap}; test_assert( $client ); *************** *** 181,185 **** # can be reclassified. It should say 'no!' foreach ( 1 .. 5 ) { ! my $hash = ($h->get_slot_fields( $_ ))[6]; test_assert_equal( $im->can_reclassify__( $hash, 'spam' ), undef ); test_assert( ! $im->can_classify__( $hash ) ); --- 186,190 ---- # can be reclassified. It should say 'no!' foreach ( 1 .. 5 ) { ! $hash = ($h->get_slot_fields( $_ ))[6]; test_assert_equal( $im->can_reclassify__( $hash, 'spam' ), undef ); test_assert( ! $im->can_classify__( $hash ) ); *************** *** 208,211 **** --- 213,237 ---- $im->disconnect_folders__(); + # Change the UIDVALIDITY values and then log in again + $im->log_( 0, '---- changing uidvalies' ); + $im->config_('login', 'someone'); + my $uidvalis = $im->config_('uidvalidities'); + my $newvalis = $uidvalis; + $newvalis =~ s/-->(\d+)-->/'-->' . ( $1 +2 ) . '-->'/ge; + $im->config_( 'uidvalidities', $newvalis ); + $im->{last_update__} = 0; + $im->service(); + $im->disconnect_folders__(); + test_assert_equal( $im->config_( 'uidvalidities' ), $uidvalis ); + $im->config_( 'uidvalidities', $uidvalis ); + + # The module is supposed to retrieve the list of mailboxes if it + # hasn't got any yet. + $im->{mailboxes__} = []; + $im->{last_update__} = 0; + $im->service(); + test_assert_equal( scalar @{$im->{mailboxes__}}, 5 ); + $im->disconnect_folders__(); + # Check what happens when we time out $im->log_( 0, "---- Testing time-out behaviour for the module." ); *************** *** 589,592 **** --- 615,619 ---- test_assert_equal( $im->config_( 'port' ), 123 ); test_assert_equal( $im->config_( 'hostname' ), 'hostname' ); + # TODO: test with values that will NOT validate # imap-watch-folders.thtml |