source: TI05-delivery/trunk/test/runclient.py @ 1247

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/trunk/test/runclient.py@1247
Revision 1247, 775 bytes checked in by spascoe, 15 years ago (diff)

New test case confirms multiple client commands works.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2"""
3This script runs the bbftp client using the python-bbftp client wrapper.  We need this
4to test client-server interactions without importing both delivery.bbftpd and delivery.bbftpc
5into the interpreter.
6"""
7
8import os, sys
9from glob import glob
10
11HOME = os.path.abspath(os.getenv('NDG_DELIVERY_HOME', os.curdir))
12BUILDDIR = glob('%s/build/lib.*' % HOME)[0]
13sys.path.append(BUILDDIR)
14
15import delivery.bbftpc as BC
16
17# Extract the command (-e) since bbftpc doesn't use it any more
18# Allow multiple commands
19args = sys.argv[1:]
20cmds = []
21
22while True:
23    try:
24        ei = args.index('-e')
25    except ValueError:
26        break
27    cmds.append(args[ei+1])
28    args = args[:ei] + args[ei+2:]
29
30BC.run(args)
31for cmd in cmds:
32    BC.docommand(cmd)
33BC.close()
Note: See TracBrowser for help on using the repository browser.