[Rt-commit] r8868 - rt/branches/3.7-EXPERIMENTAL/t/mail

ruz at bestpractical.com ruz at bestpractical.com
Fri Aug 31 17:13:05 EDT 2007


Author: ruz
Date: Fri Aug 31 17:13:05 2007
New Revision: 8868

Modified:
   rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-bad.t
   rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t
   rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-reverification.t

Log:
* switch new path of test data and delete some duplicated and
  not yet used functions, if we'll need them then we should
  put'em into RT::Test or close to it

Modified: rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-bad.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-bad.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-bad.t	Fri Aug 31 17:13:05 2007
@@ -49,82 +49,3 @@
     diag "unknown algorithm" if $ENV{TEST_VERBOSE};
 }
 
-sub get_contents {
-    my $glob = shift;
-
-    my ($file) = glob("lib/t/data/mail/$glob");
-    defined $file
-        or do { diag "Unable to find lib/t/data/mail/$glob"; return };
-
-    open my $mailhandle, '<', $file
-        or do { diag "Unable to read $file: $!"; return };
-
-    my $mail = do { local $/; <$mailhandle> };
-    close $mailhandle;
-
-    return $mail;
-}
-
-sub email_ok {
-    my %ARGS = @_;
-
-    my $mail = get_contents($ARGS{glob})
-        or return 0;
-
-    my ($status, $id) = RT::Test->send_via_mailgate($mail);
-    is ($status >> 8, 0, "The mail gateway exited normally");
-    ok ($id, "got id of a newly created ticket - $id");
-
-    my $tick = RT::Ticket->new( $RT::SystemUser );
-    $tick->Load( $id );
-    ok ($tick->id, "loaded ticket #$id");
-
-    is ($tick->Subject,
-        $ARGS{subject},
-        "Correct subject"
-    );
-
-    my $txn = $tick->Transactions->First;
-    my ($msg, @attachments) = @{$txn->Attachments->ItemsArrayRef};
-
-    if ($ARGS{encrypted}) {
-        is( $msg->GetHeader('X-RT-Incoming-Encryption'),
-            'Success',
-            "recorded incoming mail that is encrypted"
-        );
-        is( $msg->GetHeader('X-RT-Privacy'),
-            'PGP',
-            "recorded incoming mail that is encrypted"
-        );
-
-        like( $attachments[0]->Content,
-                $ARGS{content},
-                "incoming mail did NOT have original body"
-        );
-    }
-    else {
-        is( $msg->GetHeader('X-RT-Incoming-Encryption'),
-            'Not encrypted',
-            "recorded incoming mail that is not encrypted"
-        );
-        like( $msg->Content || $attachments[0]->Content,
-                $ARGS{content},
-                "got original content"
-        );
-    }
-
-    if (defined $ARGS{signer}) {
-        is( $msg->GetHeader('X-RT-Incoming-Signature'),
-            $ARGS{signer},
-            "recorded incoming mail that is signed"
-        );
-    }
-    else {
-        is( $msg->GetHeader('X-RT-Incoming-Signature'),
-            undef,
-            "recorded incoming mail that is not signed"
-        );
-    }
-
-    return 0;
-}

Modified: rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-realmail.t	Fri Aug 31 17:13:05 2007
@@ -59,9 +59,9 @@
 sub get_contents {
     my $eid = shift;
 
-    my ($file) = glob("lib/t/data/mail/$eid-*");
+    my ($file) = glob("t/data/mails/gnupg-basic-set/$eid-*");
     defined $file
-        or do { diag "Unable to find lib/t/data/mail/$eid-*"; return };
+        or do { diag "Unable to find t/data/mails/gnupg-basic-set/$eid-*"; return };
 
     open my $mailhandle, '<', $file
         or do { diag "Unable to read $file: $!"; return };

Modified: rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-reverification.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-reverification.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/mail/gnupg-reverification.t	Fri Aug 31 17:13:05 2007
@@ -45,7 +45,7 @@
 
 my @ticket_ids;
 
-my @files = glob("lib/t/data/mail/*-signed-*");
+my @files = glob("t/data/mails/gnupg-basic-set/*-signed-*");
 foreach my $file ( @files ) {
     diag "testing $file" if $ENV{'TEST_VERBOSE'};
 


More information about the Rt-commit mailing list