File: test.py

package info (click to toggle)
libaws 20.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,656 kB
  • sloc: ada: 95,505; python: 2,270; ansic: 1,017; makefile: 829; xml: 235; javascript: 202; java: 112; sh: 106
file content (41 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from test_support import *
import os

def create_res(name,content):
    f=open(name,'w')
    f.write(content)
    f.close();

os.mkdir('rout')

os.mkdir('dir1')
os.mkdir('dir1/sdir')
os.mkdir('dir2')

create_res('root.txt', 'root file')
create_res('dir1/text1.txt', 'text 1')
create_res('dir1/text2.txt', 'text 2')
create_res('dir1/sdir/text3.txt', 'text 3')
create_res('dir1/sdir/text4.old', 'text 4')
create_res('dir2/text5.txt', 'text 5')
create_res('dir2/text6', 'text 6')

exec_cmd('awsres',
         ['-q', '-a', '-r', 'rdemo', '-R', '-o', 'rout',
          '"dir1/*.txt"',
          '*.txt',
          'dir2'])

os.remove('root.txt')
os.remove('dir1/text1.txt')
os.remove('dir1/text2.txt')
os.remove('dir1/sdir/text3.txt')
os.remove('dir1/sdir/text4.old')
os.remove('dir2/text5.txt')
os.remove('dir2/text6')

os.rmdir('dir1/sdir')
os.rmdir('dir1')
os.rmdir('dir2')

build_and_run('rres');