Ignore:
Timestamp:
12/06/06 17:03:47 (14 years ago)
Author:
spascoe
Message:

Client-side python embedding is being implemented but doesn't pass the
test cases yet.

I've uncovered a bug (see #343) which needs fixing before the embedded client
can be fully debugged.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/test/test_embedded.py

    r1144 r1157  
    1010import sys, os, signal, time, syslog, stat 
    1111from glob import glob 
    12 import re, tempfile 
     12import re, tempfile, getopt 
    1313 
    1414HOME = os.path.abspath(os.getenv('NDG_DELIVERY_HOME', os.curdir)) 
     
    215215        output = fh.read() 
    216216 
     217        print output 
     218 
    217219        self.assertLines(['Received Auth handshake: NDG-Delivery-server %s' % VERSION], output) 
    218220 
     
    329331 
    330332 
    331 if __name__ == '__main__': 
    332     unittest.main() 
     333 
     334import delivery.bbftpc 
     335 
     336class PythonClientAuthOK(AuthOK): 
     337    """Repeat AuthOK tests with a python-embedded client. 
     338    """ 
     339 
     340    def _runClient(self, cmd, debug=False, user="testcase", privatestr=None): 
     341        """Run the client. 
     342        """ 
     343 
     344        if debug: 
     345            f = "-d" 
     346        else: 
     347            f = "-m" 
     348 
     349        # Tell bbftp to dump output to a file which is then opened for reading. 
     350        tmp = tempfile.mktemp('test_bbftpd') 
     351        args = ['-e', cmd, f, '-u', user, '-o', tmp, '-f', tmp, '-r', '1'] 
     352 
     353        if privatestr != None: 
     354            args += ['-P', privatestr] 
     355 
     356        delivery.bbftpc.run(args + ['localhost']) 
     357 
     358        fh.open(tmp) 
     359        os.remove(tmp) 
     360 
     361        return fh 
     362 
     363#if __name__ == '__main__': 
     364#    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.