[Spambayes-checkins] spambayes/spambayes/test test_sb-server.py, 1.1, 1.2

Tony Meyer anadelonbrin at users.sourceforge.net
Fri Sep 19 04:24:56 EDT 2003


Update of /cvsroot/spambayes/spambayes/spambayes/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16637/spambayes/test

Modified Files:
	test_sb-server.py 
Log Message:
Fix the sb_server test so that it again runs, and passes.

Index: test_sb-server.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/test/test_sb-server.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_sb-server.py	5 Sep 2003 01:16:46 -0000	1.1
--- test_sb-server.py	19 Sep 2003 08:24:54 -0000	1.2
***************
*** 1,5 ****
  #! /usr/bin/env python
  
! """Test the pop3proxy is working correctly.
  
  When using the -z command line option, carries out a test that the
--- 1,5 ----
  #! /usr/bin/env python
  
! """Test the POP3 proxy is working correctly.
  
  When using the -z command line option, carries out a test that the
***************
*** 83,92 ****
  import getopt
  
! # a bit of a hack to help those without spambayes on their
! # Python path - stolen from timtest.py
  import sys
  import os
  sys.path.insert(-1, os.getcwd())
! sys.path.insert(-1, os.path.dirname(os.getcwd()))
  
  from spambayes import Dibbler
--- 83,93 ----
  import getopt
  
! # We need to import sb_server, but it may not be on the PYTHONPATH.
! # Hack around this, so that if we are running in a cvs-like setup
! # everything still works.
  import sys
  import os
  sys.path.insert(-1, os.getcwd())
! sys.path.insert(-1, os.path.join(os.getcwd(), "scripts"))
  
  from spambayes import Dibbler
***************
*** 94,99 ****
  from spambayes.UserInterface import UserInterfaceServer
  from spambayes.ProxyUI import ProxyUserInterface
! from pop3proxy import BayesProxyListener
! from pop3proxy import state, _recreateState
  from spambayes.Options import options
  
--- 95,100 ----
  from spambayes.UserInterface import UserInterfaceServer
  from spambayes.ProxyUI import ProxyUserInterface
! from sb_server import BayesProxyListener
! from sb_server import state, _recreateState
  from spambayes.Options import options
  
***************
*** 101,105 ****
  # is added to the size of each message.
  HEADER_EXAMPLE = '%s: xxxxxxxxxxxxxxxxxxxx\r\n' % \
!                  options["Hammie", "header_name"]
  
  class TestListener(Dibbler.Listener):
--- 102,106 ----
  # is added to the size of each message.
  HEADER_EXAMPLE = '%s: xxxxxxxxxxxxxxxxxxxx\r\n' % \
!                  options["Headers", "classification_header_name"]
  
  class TestListener(Dibbler.Listener):
***************
*** 300,304 ****
          while response.find('\n.\r\n') == -1:
              response = response + proxy.recv(1000)
!         assert response.find(options["Hammie", "header_name"]) >= 0
  
      # Smoke-test the HTML UI.
--- 301,305 ----
          while response.find('\n.\r\n') == -1:
              response = response + proxy.recv(1000)
!         assert response.find(options["Headers", "classification_header_name"]) >= 0
  
      # Smoke-test the HTML UI.





More information about the Spambayes-checkins mailing list