File: 21.Report.Send.t

package info (click to toggle)
libmail-dmarc-perl 1.20211209-4
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 1,724 kB
  • sloc: perl: 4,937; xml: 13; makefile: 10; sh: 1
file content (49 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use strict;
use warnings;

use Data::Dumper;
use Test::More;

use Test::File::ShareDir
  -share => { -dist => { 'Mail-DMARC' => 'share' } };

use lib 'lib';

my $mod = 'Mail::DMARC::Report::Send';
use_ok($mod);
my $send = $mod->new;
isa_ok( $send,       $mod );
isa_ok( $send->smtp, 'Mail::DMARC::Report::Send::SMTP' );
isa_ok( $send->http, 'Mail::DMARC::Report::Send::HTTP' );

my $body = $send->too_big_report(
            {   uri          => 'mailto:matt@example.com',
                report_bytes => 500000,
                report_id    => 1,
                report_domain=> 'destination.com',
            }
        );

ok( $body, 'too_big_report');
#cmp_ok( $body, 'eq', sample_too_big(), 'too_big_report: content');

done_testing();
exit;

sub sample_too_big {
    return <<'EO_TOO_BIG'
This is a \'too big\' DMARC notice. The aggregate report was NOT delivered.

Report-Date: Wed, 14 Aug 2013 22:15:04 -0700
Report-Domain: destination.com
Report-ID: 1
Report-Size: 500000
Submitter: example.com
Submitting-URI: mailto:matt@example.com

Submitted by My Great Company
Generated with Mail::DMARC

EO_TOO_BIG
;
};