You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2018/10/16 15:34:25 UTC
svn commit: r1844024 - in /spamassassin/trunk/t: data/spam/pyzor pyzor.t
Author: hege
Date: Tue Oct 16 15:34:25 2018
New Revision: 1844024
URL: http://svn.apache.org/viewvc?rev=1844024&view=rev
Log:
Add pyzor tests
Added:
spamassassin/trunk/t/data/spam/pyzor
spamassassin/trunk/t/pyzor.t (with props)
Added: spamassassin/trunk/t/data/spam/pyzor
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/data/spam/pyzor?rev=1844024&view=auto
==============================================================================
--- spamassassin/trunk/t/data/spam/pyzor (added)
+++ spamassassin/trunk/t/data/spam/pyzor Tue Oct 16 15:34:25 2018
@@ -0,0 +1,27 @@
+Return-Path: <at...@aol.jp>
+Received: from menards.com ([185.216.140.105] [185.216.140.105])
+ by redacted.example.com (amavisd-milter);
+ Mon, 15 Oct 2018 12:13:39 +0300 (EEST)
+ (envelope-from <at...@aol.jp>)
+To: redacted@redacted.example.com
+Subject: Working test 6
+Message-ID: <8p...@bplampsupply.com>
+Date: Mon, 15 Oct 2018 11:13:39 +0200
+From: "Judy" <at...@aol.jp>
+Reply-To: dusimtane@aliyun.com
+MIME-Version: 1.0
+Content-Type: text/plain; format=flowed; charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+Did you get my email from last week?
+Let me know if you have photos for cutting out or retouching?
+
+We are an image team who can do editing for your the web store photos,
+industry photos or portrait photos.
+
+Send photos, we will do testing for you to check quality.
+Waiting for your reply soon.
+
+Thanks,
+Judy
+
Added: spamassassin/trunk/t/pyzor.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/pyzor.t?rev=1844024&view=auto
==============================================================================
--- spamassassin/trunk/t/pyzor.t (added)
+++ spamassassin/trunk/t/pyzor.t Tue Oct 16 15:34:25 2018
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use lib '.';
+use lib 't';
+use SATest;
+sa_t_init("pyzor");
+
+use constant HAS_PYZOR => eval { $_ = `which pyzor`; chomp; -x };
+
+use Test::More;
+plan skip_all => "Net tests disabled" unless conf_bool('run_net_tests');
+plan skip_all => "Pyzor executable not found in path" unless HAS_PYZOR;
+plan tests => 4;
+
+diag('Note: Failures may not be an SpamAssassin bug, as Pyzor tests can fail due to problems with the Pyzor servers.');
+
+# ---------------------------------------------------------------------------
+
+tstpre ("
+loadplugin Mail::SpamAssassin::Plugin::Pyzor
+pyzor_timeout 10
+");
+
+#PYZOR file was from real-world spam in October 2018
+
+#TESTING FOR SPAM
+%patterns = (
+ q{ Listed in Pyzor }, 'spam',
+ );
+
+sarun ("-t < data/spam/pyzor", \&patterns_run_cb);
+ok_all_patterns();
+# Same with fork
+sarun ("--cf='pyzor_fork 1' -t < data/spam/pyzor", \&patterns_run_cb);
+ok_all_patterns();
+
+#TESTING FOR HAM
+%patterns = ();
+%anti_patterns = (
+ q{ Listed in Pyzor }, 'nonspam',
+ );
+
+sarun ("-t < data/nice/001", \&patterns_run_cb);
+ok_all_patterns();
+# same with fork
+sarun ("--cf='pyzor_fork 1' -t < data/nice/001", \&patterns_run_cb);
+ok_all_patterns();
Propchange: spamassassin/trunk/t/pyzor.t
------------------------------------------------------------------------------
svn:executable = *