~mterry/duplicity/backend-unification

« back to all changes in this revision

Viewing changes to testing/overrides/bin/ncftpls

  • Committer: Michael Terry
  • Date: 2014-04-22 18:10:18 UTC
  • Revision ID: michael.terry@canonical.com-20140422181018-lslachv59wdrl3ng
Add ftp backend test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
from duplicity.backend import ParsedUrl
 
4
import os
 
5
import subprocess
 
6
import sys
 
7
 
 
8
if sys.argv[1] == '-v':
 
9
    print 'blah 3.2.1'
 
10
    sys.exit(8)  # really, the backend expects 8 as the return
 
11
 
 
12
for arg in sys.argv:
 
13
    if arg.startswith('DELE '):
 
14
        pu = ParsedUrl(sys.argv[-1])
 
15
        filename = os.path.join(pu.path.lstrip('/'), arg.split()[1])
 
16
        sys.exit(subprocess.call(['rm', filename]))
 
17
 
 
18
pu = ParsedUrl(sys.argv[-1])
 
19
sys.exit(subprocess.call(['ls', '-l', pu.path.lstrip('/')]))