~barry/ubuntu-system-image/citrain30

« back to all changes in this revision

Viewing changes to debian/tests/prep.py

  • Committer: Barry Warsaw
  • Date: 2015-05-19 20:27:26 UTC
  • Revision ID: barry@python.org-20150519202726-y1xdzsw5rmwz0ndp
d/patches: Update the DEP-8 tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python3
2
2
 
 
3
# Copyright (C) 2013-2015 Canonical Ltd.
 
4
# Author: Barry Warsaw <barry@ubuntu.com>
 
5
 
3
6
import os
4
7
 
5
8
tmpdir = os.environ['ADTTMP']
8
11
os.makedirs(os.path.join(tmpdir, 'android'), exist_ok=True)
9
12
os.makedirs(os.path.join(tmpdir, 'ubuntu'), exist_ok=True)
10
13
 
 
14
config_d = os.path.join(tmpdir, 'config.d')
 
15
os.makedirs(config_d, exists_ok=True)
 
16
 
11
17
substitutions = dict(
12
18
    TMPDIR=tmpdir,
13
19
    ARTIFACTS=artifacts,
14
20
    )
15
21
 
16
 
with open('debian/tests/client.ini.in', encoding='utf-8') as fp:
 
22
with open('debian/tests/00_default.ini.in', encoding='utf-8') as fp:
17
23
    ini_template = fp.read()
18
24
 
19
25
ini_contents = ini_template.format(**substitutions)
20
26
 
21
 
with open(os.path.join(tmpdir, 'client.ini'), 'w', encoding='utf-8') as fp:
 
27
default_ini = os.path.join(config_d, '00_default.ini')
 
28
with open(default_ini, 'w', encoding='utf-8') as fp:
22
29
    fp.write(ini_contents)