mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-18 22:11:30 +00:00
Make test_autopkgtest pass again
This commit is contained in:
parent
b3562dbfe8
commit
5d0c4a6b1e
@ -40,8 +40,9 @@ class TestData:
|
|||||||
'''
|
'''
|
||||||
self.path = tempfile.mkdtemp(prefix='testarchive.')
|
self.path = tempfile.mkdtemp(prefix='testarchive.')
|
||||||
self.apt_source = 'deb file://%s /' % self.path
|
self.apt_source = 'deb file://%s /' % self.path
|
||||||
self.dirs = {False: os.path.join(self.path, 'data', 'testing'),
|
self.series = 'series'
|
||||||
True: os.path.join(self.path, 'data', 'unstable')}
|
self.dirs = {False: os.path.join(self.path, 'data', self.series),
|
||||||
|
True: os.path.join(self.path, 'data', '%s-proposed' % self.series)}
|
||||||
os.makedirs(self.dirs[False])
|
os.makedirs(self.dirs[False])
|
||||||
os.mkdir(self.dirs[True])
|
os.mkdir(self.dirs[True])
|
||||||
self.added_sources = {False: set(), True: set()}
|
self.added_sources = {False: set(), True: set()}
|
||||||
@ -240,7 +241,9 @@ args.func()
|
|||||||
Assert that it succeeds and does not produce anything on stderr.
|
Assert that it succeeds and does not produce anything on stderr.
|
||||||
Return (excuses.html, britney_out).
|
Return (excuses.html, britney_out).
|
||||||
'''
|
'''
|
||||||
britney = subprocess.Popen([self.britney, '-v', '-c', self.britney_conf],
|
britney = subprocess.Popen([self.britney, '-v', '-c', self.britney_conf,
|
||||||
|
'--distribution=ubuntu',
|
||||||
|
'--series=%s' % self.data.series],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
cwd=self.data.path,
|
cwd=self.data.path,
|
||||||
@ -249,7 +252,8 @@ args.func()
|
|||||||
self.assertEqual(britney.returncode, 0, out + err)
|
self.assertEqual(britney.returncode, 0, out + err)
|
||||||
self.assertEqual(err, '')
|
self.assertEqual(err, '')
|
||||||
|
|
||||||
with open(os.path.join(self.data.path, 'output', 'excuses.html')) as f:
|
with open(os.path.join(self.data.path, 'output', self.data.series,
|
||||||
|
'excuses.html')) as f:
|
||||||
excuses = f.read()
|
excuses = f.read()
|
||||||
|
|
||||||
return (excuses, out)
|
return (excuses, out)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user