Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5738/tests
Modified Files:
Tag: b0_22_2
TestIMAP.tst
Log Message:
Add yet more tests for validate_item.
New coverage values: 86% und 82% for Client.pm and IMAP.pm, respectively.
Index: TestIMAP.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v
retrieving revision 1.3.4.7
retrieving revision 1.3.4.8
diff -C2 -d -r1.3.4.7 -r1.3.4.8
*** TestIMAP.tst 23 Nov 2007 07:00:18 -0000 1.3.4.7
--- TestIMAP.tst 23 Nov 2007 11:08:43 -0000 1.3.4.8
***************
*** 379,388 ****
# Here's a list of all the templates we have to test:
- # imap-bucket-folders.thtml
- # imap-options.thtml
- # imap-watch-folders.thtml
# imap-connection-details.thtml
! # imap-update-mailbox-list.thtml
# imap-watch-more-folders.thtml
# We also need to provide those methods with a language hash:
--- 379,388 ----
# Here's a list of all the templates we have to test:
# imap-connection-details.thtml
! # imap-watch-folders.thtml
# imap-watch-more-folders.thtml
+ # imap-bucket-folders.thtml
+ # imap-update-mailbox-list.thtml
+ # imap-options.thtml
# We also need to provide those methods with a language hash:
***************
*** 573,576 ****
--- 573,578 ----
# We now will have to test validate_item.
+
+ # imap-connection-details.thtml
my $form = {};
$tmpl = HTML::Template->new( filename => '../skins/default/imap-connection-details.thtml' );
***************
*** 588,591 ****
--- 590,594 ----
test_assert_equal( $im->config_( 'hostname' ), 'hostname' );
+ # imap-watch-folders.thtml
$form = {};
$tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-folders.thtml' );
***************
*** 600,604 ****
test_assert_equal( $folders[0], 'first watched folder' );
test_assert_equal( $folders[1], 'second watched folder' );
! }
--- 603,648 ----
test_assert_equal( $folders[0], 'first watched folder' );
test_assert_equal( $folders[1], 'second watched folder' );
!
! # imap-watch-more-folders.thtml
! $form = {};
! $form->{imap_2_watch_more_folders} = 1;
! $tmpl = HTML::Template->new( filename => '../skins/default/imap-watch-more-folders.thtml' );
! $im->validate_item( 'imap_2_watch_more_folders', $tmpl, $language, $form );
! @folders = $im->watched_folders__();
! test_assert_equal( scalar @folders, 3 );
! test_assert_equal( pop @folders, 'INBOX' );
!
! # imap-bucket-folders.thtml
! $form = {};
! $form->{imap_3_bucket_folders} = 1;
! $tmpl = HTML::Template->new( filename => '../skins/default/imap-bucket-folders.thtml' );
! $im->validate_item('imap_3_bucket_folders', $tmpl, $language, $form );
!
!
! # imap-update-mailbox-list.thtml
! $form = {};
! $form->{do_imap_4_update_mailbox_list} = 1;
! $tmpl = HTML::Template->new( filename => '../skins/default/imap-update-mailbox-list.thtml' );
! $im->validate_item( 'imap_4_update_mailbox_list', $tmpl, $language, $form );
!
!
! # imap-options.thtml
! $form = {};
! $tmpl = HTML::Template->new( filename => '../skins/default/imap-options.thtml' );
! $form->{update_imap_5_options} = 1;
! $form->{imap_options_expunge} = 1;
! $form->{imap_options_update_interval} = 1234;
! $im->validate_item( 'imap_5_options', $tmpl, $language, $form );
! test_assert_equal( $im->config_( 'expunge' ), 1 );
! test_assert_equal( $im->config_( 'update_interval' ), 1234 );
!
! $form->{imap_options_expunge} = undef;
! $im->validate_item( 'imap_5_options', $tmpl, $language, $form );
! test_assert_equal( $im->config_( 'expunge' ), 0 );
!
! $form->{imap_options_update_interval} = 0;
! $im->validate_item( 'imap_5_options', $tmpl, $language, $form );
! test_assert_equal( $tmpl->param('IMAP_if_interval_error'), 1 );
! }
|