Cleanup the boottest-britney testing script to reflect better its real behavior.

bzr-import-20160707
Celso Providelo 10 years ago
parent 1e8dc398e9
commit 436dadae0a

@ -166,22 +166,24 @@ class TestBoottestEnd2End(TestBase):
f.write('''#!%(py)s f.write('''#!%(py)s
import argparse import argparse
import os import os
import shutil
import sys import sys
template = """ template = """
green 1.1~beta RUNNING green 1.1~beta green 1.1~beta RUNNING
pyqt5-src 1.1~beta PASS pyqt5-src 1.1~beta pyqt5-src 1.1~beta PASS
pyqt5-src 1.1 FAIL pyqt5-src 1.1 pyqt5-src 1.1 FAIL
""" """
def request(): def request():
os.makedirs(os.path.dirname(args.output)) work_path = os.path.dirname(args.output)
os.makedirs(work_path)
shutil.copy(args.input, os.path.join(work_path, 'test_input'))
with open(args.output, 'w') as f: with open(args.output, 'w') as f:
f.write(template) f.write(template)
def submit(): def submit():
with open(args.input, 'w') as f: pass
f.write(template)
def collect(): def collect():
with open(args.output, 'w') as f: with open(args.output, 'w') as f:
@ -191,7 +193,9 @@ p = argparse.ArgumentParser()
p.add_argument('-d') p.add_argument('-d')
p.add_argument('-s') p.add_argument('-s')
p.add_argument('-c') p.add_argument('-c')
sp = p.add_subparsers() sp = p.add_subparsers()
psubmit = sp.add_parser('submit') psubmit = sp.add_parser('submit')
psubmit.add_argument('input') psubmit.add_argument('input')
psubmit.set_defaults(func=submit) psubmit.set_defaults(func=submit)
@ -243,6 +247,14 @@ args.func()
BootTest.EXCUSE_LABELS['RUNNING']), BootTest.EXCUSE_LABELS['RUNNING']),
'<li>Not considered']) '<li>Not considered'])
# The `boottest-britney` input (recorded for testing purposes),
# contains a line matching the requested boottest attempt.
# '<source> <version>\n'
test_input_path = os.path.join(
self.data.path, 'boottest/work/test_input')
self.assertEqual(
['green 1.1~beta\n'], open(test_input_path).readlines())
def test_pass(self): def test_pass(self):
# `Britney` updates boottesting information in excuses when the # `Britney` updates boottesting information in excuses when the
# package test pass and marks the package as a valid candidate for # package test pass and marks the package as a valid candidate for

Loading…
Cancel
Save