spambayes/spambayes/test test_stats.py, 1.3, 1.4

"Tony Meyer" <[email protected]>
Newsgroups gmane.mail.spam.spambayes.cvs
Message-ID <[email protected]>
Update of /cvsroot/spambayes/spambayes/spambayes/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4161/spambayes/test

Modified Files:
	test_stats.py 
Log Message:
Allow the RecordTraining method to be given the old class as a string as well as as
 a score.

Index: test_stats.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/test/test_stats.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_stats.py	20 Jan 2005 03:42:10 -0000	1.3
--- test_stats.py	6 Apr 2005 02:42:05 -0000	1.4
***************
*** 96,99 ****
--- 96,123 ----
          self.assertEqual(self.s.num_trained_spam_fn, 1)
  
+     def test_record_fp_class(self):
+         self.s.RecordTraining(True,
+                               old_class=options["Headers",
+                                                 "header_spam_string"])
+         self.assertEqual(self.s.num_trained_ham, 1)
+         self.assertEqual(self.s.num_trained_ham_fp, 1)
+ 
+     def test_record_fn_class(self):
+         self.s.RecordTraining(False,
+                               old_class=options["Headers",
+                                                 "header_ham_string"])
+         self.assertEqual(self.s.num_trained_spam, 1)
+         self.assertEqual(self.s.num_trained_spam_fn, 1)
+ 
+     def test_no_record_fp(self):
+         self.s.RecordTraining(True)
+         self.assertEqual(self.s.num_trained_ham, 1)
+         self.assertEqual(self.s.num_trained_ham_fp, 0)
+ 
+     def test_no_record_fn(self):
+         self.s.RecordTraining(False)
+         self.assertEqual(self.s.num_trained_spam, 1)
+         self.assertEqual(self.s.num_trained_spam_fn, 0)
+ 
      def test_record_train_spam(self):
          self.s.RecordTraining(False, 1.0)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.