Target E251 - Unexpected spaces around keyword
https://www.flake8rules.com/rules/E251.html
This commit is contained in:
parent
d8f5d0874e
commit
27c364b0c9
2
.flake8
2
.flake8
@ -1,4 +1,4 @@
|
|||||||
[flake8]
|
[flake8]
|
||||||
exclude = abichecker
|
exclude = abichecker
|
||||||
max-line-length = 100
|
max-line-length = 100
|
||||||
ignore = W503,W504,E501,F401,E128,E251
|
ignore = W503,W504,E501,F401,E128
|
||||||
|
24
ReviewBot.py
24
ReviewBot.py
@ -40,7 +40,7 @@ class PackageLookup(object):
|
|||||||
""" helper class to manage 00Meta/lookup.yml
|
""" helper class to manage 00Meta/lookup.yml
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, apiurl = None):
|
def __init__(self, apiurl=None):
|
||||||
self.apiurl = apiurl
|
self.apiurl = apiurl
|
||||||
# dict[project][package]
|
# dict[project][package]
|
||||||
self.lookup = {}
|
self.lookup = {}
|
||||||
@ -92,7 +92,7 @@ class ReviewBot(object):
|
|||||||
('openSUSE.org:', 'https://api.opensuse.org', 'obsrq'),
|
('openSUSE.org:', 'https://api.opensuse.org', 'obsrq'),
|
||||||
]}
|
]}
|
||||||
|
|
||||||
def __init__(self, apiurl = None, dryrun = False, logger = None, user = None, group = None):
|
def __init__(self, apiurl=None, dryrun=False, logger=None, user=None, group=None):
|
||||||
self.apiurl = apiurl
|
self.apiurl = apiurl
|
||||||
self.ibs = apiurl.startswith('https://api.suse.de')
|
self.ibs = apiurl.startswith('https://api.suse.de')
|
||||||
self.dryrun = dryrun
|
self.dryrun = dryrun
|
||||||
@ -117,12 +117,12 @@ class ReviewBot(object):
|
|||||||
|
|
||||||
self.load_config()
|
self.load_config()
|
||||||
|
|
||||||
def _load_config(self, handle = None):
|
def _load_config(self, handle=None):
|
||||||
d = self.__class__.config_defaults
|
d = self.__class__.config_defaults
|
||||||
y = yaml.safe_load(handle) if handle is not None else {}
|
y = yaml.safe_load(handle) if handle is not None else {}
|
||||||
return namedtuple('BotConfig', sorted(d.keys()))(*[y.get(p, d[p]) for p in sorted(d.keys())])
|
return namedtuple('BotConfig', sorted(d.keys()))(*[y.get(p, d[p]) for p in sorted(d.keys())])
|
||||||
|
|
||||||
def load_config(self, filename = None):
|
def load_config(self, filename=None):
|
||||||
if filename:
|
if filename:
|
||||||
with open(filename, 'r') as fh:
|
with open(filename, 'r') as fh:
|
||||||
self.config = self._load_config(fh)
|
self.config = self._load_config(fh)
|
||||||
@ -301,7 +301,7 @@ class ReviewBot(object):
|
|||||||
if not self.dryrun:
|
if not self.dryrun:
|
||||||
try:
|
try:
|
||||||
osc.core.change_review_state(apiurl=self.apiurl,
|
osc.core.change_review_state(apiurl=self.apiurl,
|
||||||
reqid = req.reqid, newstate = newstate,
|
reqid=req.reqid, newstate=newstate,
|
||||||
by_group=self.review_group,
|
by_group=self.review_group,
|
||||||
by_user=self.review_user, message=msg)
|
by_user=self.review_user, message=msg)
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
@ -774,7 +774,7 @@ class ReviewBot(object):
|
|||||||
else:
|
else:
|
||||||
return comment['comment'].count('\n') == message.count('\n')
|
return comment['comment'].count('\n') == message.count('\n')
|
||||||
|
|
||||||
def _check_matching_srcmd5(self, project, package, rev, history_limit = 5):
|
def _check_matching_srcmd5(self, project, package, rev, history_limit=5):
|
||||||
"""check if factory sources contain the package and revision. check head and history"""
|
"""check if factory sources contain the package and revision. check head and history"""
|
||||||
self.logger.debug("checking %s in %s" % (package, project))
|
self.logger.debug("checking %s in %s" % (package, project))
|
||||||
try:
|
try:
|
||||||
@ -877,7 +877,7 @@ class CommandLineInterface(cmdln.Cmdln):
|
|||||||
logging.basicConfig(level=level, format='[%(levelname).1s] %(message)s')
|
logging.basicConfig(level=level, format='[%(levelname).1s] %(message)s')
|
||||||
self.logger = logging.getLogger(self.optparser.prog)
|
self.logger = logging.getLogger(self.optparser.prog)
|
||||||
|
|
||||||
conf.get_config(override_apiurl = self.options.apiurl)
|
conf.get_config(override_apiurl=self.options.apiurl)
|
||||||
|
|
||||||
if (self.options.osc_debug):
|
if (self.options.osc_debug):
|
||||||
conf.config['debug'] = 1
|
conf.config['debug'] = 1
|
||||||
@ -911,11 +911,11 @@ class CommandLineInterface(cmdln.Cmdln):
|
|||||||
if user is None and group is None:
|
if user is None and group is None:
|
||||||
user = conf.get_apiurl_usr(apiurl)
|
user = conf.get_apiurl_usr(apiurl)
|
||||||
|
|
||||||
return self.clazz(apiurl = apiurl,
|
return self.clazz(apiurl=apiurl,
|
||||||
dryrun = self.options.dry,
|
dryrun=self.options.dry,
|
||||||
user = user,
|
user=user,
|
||||||
group = group,
|
group=group,
|
||||||
logger = self.logger)
|
logger=self.logger)
|
||||||
|
|
||||||
def do_id(self, subcmd, opts, *args):
|
def do_id(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: check the specified request ids
|
"""${cmd_name}: check the specified request ids
|
||||||
|
10
ToolBase.py
10
ToolBase.py
@ -147,16 +147,16 @@ class CommandLineInterface(cmdln.Cmdln):
|
|||||||
|
|
||||||
logging.basicConfig(level=level)
|
logging.basicConfig(level=level)
|
||||||
|
|
||||||
osc.conf.get_config(override_apiurl = self.options.apiurl,
|
osc.conf.get_config(override_apiurl=self.options.apiurl,
|
||||||
override_debug = self.options.osc_debug,
|
override_debug=self.options.osc_debug,
|
||||||
override_http_debug = self.options.http_debug,
|
override_http_debug=self.options.http_debug,
|
||||||
override_http_full_debug = self.options.http_full_debug)
|
override_http_full_debug=self.options.http_full_debug)
|
||||||
|
|
||||||
self.tool = self.setup_tool()
|
self.tool = self.setup_tool()
|
||||||
self.tool.dryrun = self.options.dry
|
self.tool.dryrun = self.options.dry
|
||||||
self.tool.caching = self.options.cache_requests
|
self.tool.caching = self.options.cache_requests
|
||||||
|
|
||||||
def setup_tool(self, toolclass = ToolBase):
|
def setup_tool(self, toolclass=ToolBase):
|
||||||
""" reimplement this """
|
""" reimplement this """
|
||||||
|
|
||||||
tool = toolclass()
|
tool = toolclass()
|
||||||
|
@ -48,7 +48,7 @@ class BiArchTool(ToolBase.ToolBase):
|
|||||||
'000release-packages'])
|
'000release-packages'])
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_filelist(self, project, package, expand = False):
|
def get_filelist(self, project, package, expand=False):
|
||||||
query = {}
|
query = {}
|
||||||
if expand:
|
if expand:
|
||||||
query['expand'] = 1
|
query['expand'] = 1
|
||||||
@ -74,7 +74,7 @@ class BiArchTool(ToolBase.ToolBase):
|
|||||||
else:
|
else:
|
||||||
ret = True
|
ret = True
|
||||||
elif '_link' in files:
|
elif '_link' in files:
|
||||||
files = self.get_filelist(self.project, srcpkgname, expand = True)
|
files = self.get_filelist(self.project, srcpkgname, expand=True)
|
||||||
if 'baselibs.conf' in files:
|
if 'baselibs.conf' in files:
|
||||||
logger.warning('%s is linked to a baselibs package', package)
|
logger.warning('%s is linked to a baselibs package', package)
|
||||||
elif is_multibuild:
|
elif is_multibuild:
|
||||||
@ -310,7 +310,7 @@ class CommandLineInterface(ToolBase.CommandLineInterface):
|
|||||||
parser = ToolBase.CommandLineInterface.get_optparser(self)
|
parser = ToolBase.CommandLineInterface.get_optparser(self)
|
||||||
parser.add_option('-p', '--project', dest='project', metavar='PROJECT',
|
parser.add_option('-p', '--project', dest='project', metavar='PROJECT',
|
||||||
help='project to process (default: %s)' % FACTORY,
|
help='project to process (default: %s)' % FACTORY,
|
||||||
default = FACTORY)
|
default=FACTORY)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def setup_tool(self):
|
def setup_tool(self):
|
||||||
|
@ -70,7 +70,7 @@ class BugownerTool(ToolBase.ToolBase):
|
|||||||
|
|
||||||
return missing
|
return missing
|
||||||
|
|
||||||
def find_owner(self, package, role = 'bugowner'):
|
def find_owner(self, package, role='bugowner'):
|
||||||
# XXX: not actually looking for package but binary
|
# XXX: not actually looking for package but binary
|
||||||
# https://github.com/openSUSE/open-build-service/issues/4359
|
# https://github.com/openSUSE/open-build-service/issues/4359
|
||||||
url = self.makeurl(['search', 'owner'], {'binary': package})
|
url = self.makeurl(['search', 'owner'], {'binary': package})
|
||||||
@ -139,7 +139,7 @@ class CommandLineInterface(ToolBase.CommandLineInterface):
|
|||||||
parser = ToolBase.CommandLineInterface.get_optparser(self)
|
parser = ToolBase.CommandLineInterface.get_optparser(self)
|
||||||
parser.add_option('-p', '--project', dest='project', metavar='PROJECT',
|
parser.add_option('-p', '--project', dest='project', metavar='PROJECT',
|
||||||
help='project to process (default: %s)' % FACTORY,
|
help='project to process (default: %s)' % FACTORY,
|
||||||
default = FACTORY)
|
default=FACTORY)
|
||||||
parser.add_option('--reference-project', metavar='PROJECT',
|
parser.add_option('--reference-project', metavar='PROJECT',
|
||||||
action='append', help='reference project')
|
action='append', help='reference project')
|
||||||
return parser
|
return parser
|
||||||
|
@ -245,6 +245,6 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
level = None
|
level = None
|
||||||
|
|
||||||
logging.basicConfig(level = level)
|
logging.basicConfig(level=level)
|
||||||
|
|
||||||
sys.exit(main(args))
|
sys.exit(main(args))
|
||||||
|
@ -38,8 +38,8 @@ class MaintenanceChecker(ReviewBot.ReviewBot):
|
|||||||
if prj.startswith('openSUSE:Leap') or prj.startswith('openSUSE:1'):
|
if prj.startswith('openSUSE:Leap') or prj.startswith('openSUSE:1'):
|
||||||
self.logger.debug("%s looks wrong as maintainer, skipped", prj)
|
self.logger.debug("%s looks wrong as maintainer, skipped", prj)
|
||||||
continue
|
continue
|
||||||
self.add_review(req, by_project = prj, by_package = pkg,
|
self.add_review(req, by_project=prj, by_package=pkg,
|
||||||
msg = 'Submission for {} by someone who is not maintainer in the devel project ({}). Please review'.format(pkg, prj))
|
msg='Submission for {} by someone who is not maintainer in the devel project ({}). Please review'.format(pkg, prj))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@memoize(session=True)
|
@memoize(session=True)
|
||||||
|
@ -305,7 +305,7 @@ class CheckSource(ReviewBot.ReviewBot):
|
|||||||
repo = f.attrib['name']
|
repo = f.attrib['name']
|
||||||
query = {'last': 1, }
|
query = {'last': 1, }
|
||||||
for arch in target_archs(self.apiurl, source_project, repo):
|
for arch in target_archs(self.apiurl, source_project, repo):
|
||||||
url = osc.core.makeurl(self.apiurl, ['build', source_project, repo, arch, source_package, '_log'], query = query)
|
url = osc.core.makeurl(self.apiurl, ['build', source_project, repo, arch, source_package, '_log'], query=query)
|
||||||
try:
|
try:
|
||||||
result = osc.core.http_GET(url)
|
result = osc.core.http_GET(url)
|
||||||
contents = str(result.read())
|
contents = str(result.read())
|
||||||
|
@ -141,7 +141,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
osc.conf.get_config(override_apiurl = args.apiurl)
|
osc.conf.get_config(override_apiurl=args.apiurl)
|
||||||
osc.conf.config['debug'] = args.debug
|
osc.conf.config['debug'] = args.debug
|
||||||
apiurl = osc.conf.config['apiurl']
|
apiurl = osc.conf.config['apiurl']
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
rendered = render_template('dashboard.html',
|
rendered = render_template('dashboard.html',
|
||||||
projectname = args.project,
|
projectname=args.project,
|
||||||
lastupdate = datetime.now(timezone.utc),
|
lastupdate=datetime.now(timezone.utc),
|
||||||
projects = fetcher.projects)
|
projects=fetcher.projects)
|
||||||
print(rendered)
|
print(rendered)
|
||||||
|
@ -25,7 +25,7 @@ config_defaults = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _load_config(handle = None):
|
def _load_config(handle=None):
|
||||||
d = config_defaults
|
d = config_defaults
|
||||||
y = yaml.safe_load(handle) if handle is not None else {}
|
y = yaml.safe_load(handle) if handle is not None else {}
|
||||||
keys = set(d.keys()) | set(y.keys())
|
keys = set(d.keys()) | set(y.keys())
|
||||||
|
@ -271,7 +271,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
osc.conf.get_config(override_apiurl = args.apiurl)
|
osc.conf.get_config(override_apiurl=args.apiurl)
|
||||||
osc.conf.config['debug'] = args.debug
|
osc.conf.config['debug'] = args.debug
|
||||||
|
|
||||||
apiurl = osc.conf.config['apiurl']
|
apiurl = osc.conf.config['apiurl']
|
||||||
|
@ -313,7 +313,7 @@ def fileinfo_ext(apiurl, project, repo, arch, package, filename):
|
|||||||
return ET.parse(http_GET(url)).getroot()
|
return ET.parse(http_GET(url)).getroot()
|
||||||
|
|
||||||
|
|
||||||
def builddepinfo(apiurl, project, repo, arch, order = False):
|
def builddepinfo(apiurl, project, repo, arch, order=False):
|
||||||
query = {}
|
query = {}
|
||||||
if order:
|
if order:
|
||||||
query['view'] = 'order'
|
query['view'] = 'order'
|
||||||
|
@ -684,8 +684,8 @@ class PkgListGen(ToolBase.ToolBase):
|
|||||||
else:
|
else:
|
||||||
summary = self.solve_project(ignore_unresolvable=str2bool(target_config.get('pkglistgen-ignore-unresolvable')),
|
summary = self.solve_project(ignore_unresolvable=str2bool(target_config.get('pkglistgen-ignore-unresolvable')),
|
||||||
ignore_recommended=str2bool(target_config.get('pkglistgen-ignore-recommended')),
|
ignore_recommended=str2bool(target_config.get('pkglistgen-ignore-recommended')),
|
||||||
locale = target_config.get('pkglistgen-locale'),
|
locale=target_config.get('pkglistgen-locale'),
|
||||||
locales_from = target_config.get('pkglistgen-locales-from'))
|
locales_from=target_config.get('pkglistgen-locales-from'))
|
||||||
|
|
||||||
if stop_after_solve:
|
if stop_after_solve:
|
||||||
return
|
return
|
||||||
|
@ -235,7 +235,7 @@ class TestCase(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
wf.create_user(user)
|
wf.create_user(user)
|
||||||
prj = wf.projects[project]
|
prj = wf.projects[project]
|
||||||
prj.add_reviewers(users = [user])
|
prj.add_reviewers(users=[user])
|
||||||
|
|
||||||
bot_name = self.generate_bot_name(user)
|
bot_name = self.generate_bot_name(user)
|
||||||
bot = bot_class(wf.apiurl, user=user, logger=logging.getLogger(bot_name))
|
bot = bot_class(wf.apiurl, user=user, logger=logging.getLogger(bot_name))
|
||||||
@ -653,7 +653,7 @@ class StagingWorkflow(ABC):
|
|||||||
|
|
||||||
self.create_user('staging-bot')
|
self.create_user('staging-bot')
|
||||||
self.create_group(group, users=['staging-bot'])
|
self.create_group(group, users=['staging-bot'])
|
||||||
self.projects['target'].add_reviewers(groups = [group])
|
self.projects['target'].add_reviewers(groups=[group])
|
||||||
|
|
||||||
url = osc.core.makeurl(APIURL, ['staging', self.project, 'workflow'])
|
url = osc.core.makeurl(APIURL, ['staging', self.project, 'workflow'])
|
||||||
data = f"<workflow managers='{group}'/>"
|
data = f"<workflow managers='{group}'/>"
|
||||||
@ -919,7 +919,7 @@ class Project(object):
|
|||||||
|
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
def add_reviewers(self, users = [], groups = []):
|
def add_reviewers(self, users=[], groups=[]):
|
||||||
"""Adds the given reviewers to the meta information of the project
|
"""Adds the given reviewers to the meta information of the project
|
||||||
|
|
||||||
:param users: usernames to add to the current list of reviewers
|
:param users: usernames to add to the current list of reviewers
|
||||||
|
@ -39,7 +39,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
self.bot_user = 'factory-auto'
|
self.bot_user = 'factory-auto'
|
||||||
self.wf.create_user(self.bot_user)
|
self.wf.create_user(self.bot_user)
|
||||||
# When creating a review, set the by_user to bot_user
|
# When creating a review, set the by_user to bot_user
|
||||||
self.project.add_reviewers(users = [self.bot_user])
|
self.project.add_reviewers(users=[self.bot_user])
|
||||||
|
|
||||||
# Ensure different test runs operate in unique namespace.
|
# Ensure different test runs operate in unique namespace.
|
||||||
self.bot_name = '::'.join([type(self).__name__, str(random.getrandbits(8))])
|
self.bot_name = '::'.join([type(self).__name__, str(random.getrandbits(8))])
|
||||||
@ -71,7 +71,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
"""Accepts a request coming from a devel project"""
|
"""Accepts a request coming from a devel project"""
|
||||||
self._setup_devel_project()
|
self._setup_devel_project()
|
||||||
|
|
||||||
req_id = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit = False).reqid
|
req_id = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit=False).reqid
|
||||||
|
|
||||||
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
self._setup_devel_project(devel_files='blowfish-with-patch')
|
self._setup_devel_project(devel_files='blowfish-with-patch')
|
||||||
|
|
||||||
req_id = self.wf.create_submit_request(self.devel_package.project,
|
req_id = self.wf.create_submit_request(self.devel_package.project,
|
||||||
self.devel_package.name, add_commit = False).reqid
|
self.devel_package.name, add_commit=False).reqid
|
||||||
|
|
||||||
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
self._setup_devel_project()
|
self._setup_devel_project()
|
||||||
|
|
||||||
req_id = self.wf.create_submit_request(self.devel_package.project,
|
req_id = self.wf.create_submit_request(self.devel_package.project,
|
||||||
self.devel_package.name, add_commit = False).reqid
|
self.devel_package.name, add_commit=False).reqid
|
||||||
|
|
||||||
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
target_files='blowfish-with-patch-changes')
|
target_files='blowfish-with-patch-changes')
|
||||||
|
|
||||||
req_id = self.wf.create_submit_request(self.devel_package.project,
|
req_id = self.wf.create_submit_request(self.devel_package.project,
|
||||||
self.devel_package.name, add_commit = False).reqid
|
self.devel_package.name, add_commit=False).reqid
|
||||||
|
|
||||||
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
self.wf.create_group(FACTORY_MAINTAINERS.replace('group:', ''))
|
self.wf.create_group(FACTORY_MAINTAINERS.replace('group:', ''))
|
||||||
self.wf.remote_config_set({'required-source-maintainer': FACTORY_MAINTAINERS})
|
self.wf.remote_config_set({'required-source-maintainer': FACTORY_MAINTAINERS})
|
||||||
|
|
||||||
req = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit = False)
|
req = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit=False)
|
||||||
|
|
||||||
self.assertReview(req.reqid, by_user=(self.bot_user, 'new'))
|
self.assertReview(req.reqid, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
|
|
||||||
self._setup_devel_project(maintainer={'groups': [group_name]})
|
self._setup_devel_project(maintainer={'groups': [group_name]})
|
||||||
|
|
||||||
req_id = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit = False).reqid
|
req_id = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit=False).reqid
|
||||||
|
|
||||||
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
self.assertReview(req_id, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ class TestCheckSource(OBSLocal.TestCase):
|
|||||||
|
|
||||||
self._setup_devel_project()
|
self._setup_devel_project()
|
||||||
|
|
||||||
req = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit = False)
|
req = self.wf.create_submit_request(SRC_PROJECT, 'blowfish', add_commit=False)
|
||||||
|
|
||||||
self.assertReview(req.reqid, by_user=(self.bot_user, 'new'))
|
self.assertReview(req.reqid, by_user=(self.bot_user, 'new'))
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ Pico text editor while also offering a few enhancements.</description>
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/openSUSE:Factory/00Meta/lookup.yml",
|
APIURL + "/source/openSUSE:Factory/00Meta/lookup.yml",
|
||||||
status = 404)
|
status=404)
|
||||||
|
|
||||||
result = {'state_accepted': None}
|
result = {'state_accepted': None}
|
||||||
|
|
||||||
|
@ -34,20 +34,20 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
self.logger = logging.getLogger(__file__)
|
self.logger = logging.getLogger(__file__)
|
||||||
self.logger.setLevel(logging.DEBUG)
|
self.logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
self.checker = FactorySourceChecker(apiurl = APIURL,
|
self.checker = FactorySourceChecker(apiurl=APIURL,
|
||||||
user = 'factory-source',
|
user='factory-source',
|
||||||
logger = self.logger)
|
logger=self.logger)
|
||||||
self.checker.override_allow = False # Test setup cannot handle.
|
self.checker.override_allow = False # Test setup cannot handle.
|
||||||
|
|
||||||
def test_accept_request(self):
|
def test_accept_request(self):
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/source/openSUSE:Factory/00Meta/lookup.yml',
|
APIURL + '/source/openSUSE:Factory/00Meta/lookup.yml',
|
||||||
status = 404)
|
status=404)
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/request/770001",
|
APIURL + "/request/770001",
|
||||||
body = """
|
body="""
|
||||||
<request id="770001" creator="chameleon">
|
<request id="770001" creator="chameleon">
|
||||||
<action type="submit">
|
<action type="submit">
|
||||||
<source project="Base:System" package="timezone" rev="481ecbe0dfc63ece3a1f1b5598f7d96c"/>
|
<source project="Base:System" package="timezone" rev="481ecbe0dfc63ece3a1f1b5598f7d96c"/>
|
||||||
@ -63,8 +63,8 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/Base:System/timezone?view=info&rev=481ecbe0dfc63ece3a1f1b5598f7d96c",
|
APIURL + "/source/Base:System/timezone?view=info&rev=481ecbe0dfc63ece3a1f1b5598f7d96c",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<sourceinfo package="timezone"
|
<sourceinfo package="timezone"
|
||||||
rev="481ecbe0dfc63ece3a1f1b5598f7d96c"
|
rev="481ecbe0dfc63ece3a1f1b5598f7d96c"
|
||||||
srcmd5="481ecbe0dfc63ece3a1f1b5598f7d96c"
|
srcmd5="481ecbe0dfc63ece3a1f1b5598f7d96c"
|
||||||
@ -75,7 +75,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/openSUSE:Factory/timezone/_meta",
|
APIURL + "/source/openSUSE:Factory/timezone/_meta",
|
||||||
body = """
|
body="""
|
||||||
<package name="timezone" project="openSUSE:Factory">
|
<package name="timezone" project="openSUSE:Factory">
|
||||||
<title>timezone</title>
|
<title>timezone</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
@ -84,7 +84,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/Base:System/timezone/_meta",
|
APIURL + "/source/Base:System/timezone/_meta",
|
||||||
body = """
|
body="""
|
||||||
<package name="timezone" project="Base:System">
|
<package name="timezone" project="Base:System">
|
||||||
<title>timezone</title>
|
<title>timezone</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
@ -93,8 +93,8 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/openSUSE:Factory/timezone?view=info",
|
APIURL + "/source/openSUSE:Factory/timezone?view=info",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<sourceinfo package="timezone"
|
<sourceinfo package="timezone"
|
||||||
rev="89"
|
rev="89"
|
||||||
vrev="1"
|
vrev="1"
|
||||||
@ -106,8 +106,8 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/openSUSE:Factory/timezone/_history?limit=5",
|
APIURL + "/source/openSUSE:Factory/timezone/_history?limit=5",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<sourceinfo package="timezone"
|
<sourceinfo package="timezone"
|
||||||
rev="89"
|
rev="89"
|
||||||
vrev="1"
|
vrev="1"
|
||||||
@ -119,8 +119,8 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/request',
|
APIURL + '/search/request',
|
||||||
responses = [
|
responses=[
|
||||||
httpretty.Response(body = """
|
httpretty.Response(body="""
|
||||||
<collection matches="1">
|
<collection matches="1">
|
||||||
<request id="254684" creator="chameleon">
|
<request id="254684" creator="chameleon">
|
||||||
<action type="submit">
|
<action type="submit">
|
||||||
@ -137,7 +137,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
</request>
|
</request>
|
||||||
</collection>
|
</collection>
|
||||||
"""),
|
"""),
|
||||||
httpretty.Response(body = """
|
httpretty.Response(body="""
|
||||||
<collection matches="1">
|
<collection matches="1">
|
||||||
<request id="254684" creator="chameleon">
|
<request id="254684" creator="chameleon">
|
||||||
<action type="submit">
|
<action type="submit">
|
||||||
@ -165,7 +165,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.POST,
|
httpretty.register_uri(httpretty.POST,
|
||||||
APIURL + "/request/770001",
|
APIURL + "/request/770001",
|
||||||
body = lambda method, uri, headers: change_request(result, method, uri, headers))
|
body=lambda method, uri, headers: change_request(result, method, uri, headers))
|
||||||
|
|
||||||
# first time request is in in review
|
# first time request is in in review
|
||||||
self.checker.set_request_ids(['770001'])
|
self.checker.set_request_ids(['770001'])
|
||||||
@ -183,8 +183,8 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/request?match=state%2F%40name%3D%27review%27+and+review%5B%40by_user%3D%27factory-source%27+and+%40state%3D%27new%27%5D&withfullhistory=1',
|
APIURL + '/search/request?match=state%2F%40name%3D%27review%27+and+review%5B%40by_user%3D%27factory-source%27+and+%40state%3D%27new%27%5D&withfullhistory=1',
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<collection matches="1">
|
<collection matches="1">
|
||||||
<request id="261411" creator="lnussel">
|
<request id="261411" creator="lnussel">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
@ -216,7 +216,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/request/261411",
|
APIURL + "/request/261411",
|
||||||
body = """
|
body="""
|
||||||
<request id="261411" creator="lnussel">
|
<request id="261411" creator="lnussel">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
<source project="home:lnussel:branches:openSUSE:Backports:SLE-12" package="plan" rev="71e76daf2c2e9ddb0b9208f54a14f608"/>
|
<source project="home:lnussel:branches:openSUSE:Backports:SLE-12" package="plan" rev="71e76daf2c2e9ddb0b9208f54a14f608"/>
|
||||||
@ -246,7 +246,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/home:lnussel:branches:openSUSE:Backports:SLE-12/plan",
|
APIURL + "/source/home:lnussel:branches:openSUSE:Backports:SLE-12/plan",
|
||||||
body = """
|
body="""
|
||||||
<directory name="plan" rev="1" vrev="1" srcmd5="b4ed19dc30c1b328168bc62a81ec6998">
|
<directory name="plan" rev="1" vrev="1" srcmd5="b4ed19dc30c1b328168bc62a81ec6998">
|
||||||
<linkinfo project="home:lnussel:plan" package="plan" srcmd5="7a2353f73b29dba970702053229542a0" baserev="7a2353f73b29dba970702053229542a0" xsrcmd5="71e76daf2c2e9ddb0b9208f54a14f608" lsrcmd5="b4ed19dc30c1b328168bc62a81ec6998" />
|
<linkinfo project="home:lnussel:plan" package="plan" srcmd5="7a2353f73b29dba970702053229542a0" baserev="7a2353f73b29dba970702053229542a0" xsrcmd5="71e76daf2c2e9ddb0b9208f54a14f608" lsrcmd5="b4ed19dc30c1b328168bc62a81ec6998" />
|
||||||
<entry name="_link" md5="91f81d88456818a18a7332999fb2da18" size="125" mtime="1415807350" />
|
<entry name="_link" md5="91f81d88456818a18a7332999fb2da18" size="125" mtime="1415807350" />
|
||||||
@ -257,8 +257,8 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/openSUSE:Factory/plan/_meta",
|
APIURL + "/source/openSUSE:Factory/plan/_meta",
|
||||||
status = 404,
|
status=404,
|
||||||
body = """
|
body="""
|
||||||
<status code="unknown_package">
|
<status code="unknown_package">
|
||||||
<summary>openSUSE:Factory/plan</summary>
|
<summary>openSUSE:Factory/plan</summary>
|
||||||
</status>
|
</status>
|
||||||
@ -266,11 +266,11 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/source/openSUSE:Factory/00Meta/lookup.yml',
|
APIURL + '/source/openSUSE:Factory/00Meta/lookup.yml',
|
||||||
status = 404)
|
status=404)
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/request',
|
APIURL + '/search/request',
|
||||||
body = """
|
body="""
|
||||||
<collection matches="0">
|
<collection matches="0">
|
||||||
</collection>
|
</collection>
|
||||||
""")
|
""")
|
||||||
@ -285,7 +285,7 @@ class TestFactorySourceAccept(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.POST,
|
httpretty.register_uri(httpretty.POST,
|
||||||
APIURL + "/request/261411",
|
APIURL + "/request/261411",
|
||||||
body = lambda method, uri, headers: change_request(result, method, uri, headers))
|
body=lambda method, uri, headers: change_request(result, method, uri, headers))
|
||||||
|
|
||||||
self.checker.requests = []
|
self.checker.requests = []
|
||||||
self.checker.set_request_ids_search_review()
|
self.checker.set_request_ids_search_review()
|
||||||
|
@ -94,8 +94,8 @@ class TestFactorySubmitRequest(OBSLocal.TestCase):
|
|||||||
|
|
||||||
# Let's first accept the manual review
|
# Let's first accept the manual review
|
||||||
change_review_state(
|
change_review_state(
|
||||||
apiurl = self.wf.apiurl, reqid = reqid,
|
apiurl=self.wf.apiurl, reqid=reqid,
|
||||||
newstate = 'accepted', by_group='opensuse-review-team'
|
newstate='accepted', by_group='opensuse-review-team'
|
||||||
)
|
)
|
||||||
|
|
||||||
# Now only the staging workflow is pending
|
# Now only the staging workflow is pending
|
||||||
@ -162,6 +162,6 @@ class TestFactorySubmitRequest(OBSLocal.TestCase):
|
|||||||
def __accept_license(self):
|
def __accept_license(self):
|
||||||
"""See :func:`__mock_licensedigger`"""
|
"""See :func:`__mock_licensedigger`"""
|
||||||
change_review_state(
|
change_review_state(
|
||||||
apiurl = self.wf.apiurl, reqid = self.request.reqid,
|
apiurl=self.wf.apiurl, reqid=self.request.reqid,
|
||||||
newstate = 'accepted', by_user='licensedigger'
|
newstate='accepted', by_user='licensedigger'
|
||||||
)
|
)
|
||||||
|
@ -26,9 +26,9 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
self.logger = logging.getLogger(__file__)
|
self.logger = logging.getLogger(__file__)
|
||||||
self.logger.setLevel(logging.DEBUG)
|
self.logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
self.checker = MaintenanceChecker(apiurl = APIURL,
|
self.checker = MaintenanceChecker(apiurl=APIURL,
|
||||||
user = 'maintbot',
|
user='maintbot',
|
||||||
logger = self.logger)
|
logger=self.logger)
|
||||||
self.checker.override_allow = False # Test setup cannot handle.
|
self.checker.override_allow = False # Test setup cannot handle.
|
||||||
|
|
||||||
def test_non_maintainer_submit(self):
|
def test_non_maintainer_submit(self):
|
||||||
@ -37,7 +37,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/request',
|
APIURL + '/search/request',
|
||||||
body = """
|
body="""
|
||||||
<collection matches="1">
|
<collection matches="1">
|
||||||
<request id="261355" creator="brassh">
|
<request id="261355" creator="brassh">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
@ -64,8 +64,8 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/request/261355",
|
APIURL + "/request/261355",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<request id="261355" creator="brassh">
|
<request id="261355" creator="brassh">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
<source project="home:brassh" package="mysql-workbench" rev="857c77d2ba1d347b6dc50a1e5bcb74e1"/>
|
<source project="home:brassh" package="mysql-workbench" rev="857c77d2ba1d347b6dc50a1e5bcb74e1"/>
|
||||||
@ -90,8 +90,8 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/home:brassh/mysql-workbench",
|
APIURL + "/source/home:brassh/mysql-workbench",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<directory name="mysql-workbench" rev="6" vrev="6" srcmd5="858204decf53f923d5574dbe6ae63b15">
|
<directory name="mysql-workbench" rev="6" vrev="6" srcmd5="858204decf53f923d5574dbe6ae63b15">
|
||||||
<linkinfo project="openSUSE:13.2" package="mysql-workbench" srcmd5="ed9c3b12388cbd14868eb3faabe34685" baserev="ed9c3b12388cbd14868eb3faabe34685" xsrcmd5="08bfb4f40cb1e2de8f9cd4633bf02eb1" lsrcmd5="858204decf53f923d5574dbe6ae63b15" />
|
<linkinfo project="openSUSE:13.2" package="mysql-workbench" srcmd5="ed9c3b12388cbd14868eb3faabe34685" baserev="ed9c3b12388cbd14868eb3faabe34685" xsrcmd5="08bfb4f40cb1e2de8f9cd4633bf02eb1" lsrcmd5="858204decf53f923d5574dbe6ae63b15" />
|
||||||
<serviceinfo code="succeeded" xsrcmd5="6ec4305a8e5363e26a7f4895a0ae12d2" />
|
<serviceinfo code="succeeded" xsrcmd5="6ec4305a8e5363e26a7f4895a0ae12d2" />
|
||||||
@ -118,19 +118,19 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.POST,
|
httpretty.register_uri(httpretty.POST,
|
||||||
APIURL + "/request/261355",
|
APIURL + "/request/261355",
|
||||||
body = lambda method, uri, headers: change_request(result, method, uri, headers))
|
body=lambda method, uri, headers: change_request(result, method, uri, headers))
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/search/owner?project=openSUSE:13.2:Update&binary=mysql-workbench",
|
APIURL + "/search/owner?project=openSUSE:13.2:Update&binary=mysql-workbench",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<collection/>
|
<collection/>
|
||||||
""")
|
""")
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/search/owner?binary=mysql-workbench",
|
APIURL + "/search/owner?binary=mysql-workbench",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<collection>
|
<collection>
|
||||||
<owner rootproject="openSUSE" project="server:database" package="mysql-workbench">
|
<owner rootproject="openSUSE" project="server:database" package="mysql-workbench">
|
||||||
<person name="Gankov" role="maintainer"/>
|
<person name="Gankov" role="maintainer"/>
|
||||||
@ -149,7 +149,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/request',
|
APIURL + '/search/request',
|
||||||
body = """
|
body="""
|
||||||
<collection matches="1">
|
<collection matches="1">
|
||||||
<request id="261355" creator="brassh">
|
<request id="261355" creator="brassh">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
@ -179,8 +179,8 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/request/261355",
|
APIURL + "/request/261355",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<request id="261355" creator="brassh">
|
<request id="261355" creator="brassh">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
<source project="home:brassh" package="mysql-workbench" rev="857c77d2ba1d347b6dc50a1e5bcb74e1"/>
|
<source project="home:brassh" package="mysql-workbench" rev="857c77d2ba1d347b6dc50a1e5bcb74e1"/>
|
||||||
@ -208,8 +208,8 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/home:brassh/mysql-workbench",
|
APIURL + "/source/home:brassh/mysql-workbench",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<directory name="mysql-workbench" rev="6" vrev="6" srcmd5="858204decf53f923d5574dbe6ae63b15">
|
<directory name="mysql-workbench" rev="6" vrev="6" srcmd5="858204decf53f923d5574dbe6ae63b15">
|
||||||
<linkinfo project="openSUSE:13.2" package="mysql-workbench" srcmd5="ed9c3b12388cbd14868eb3faabe34685" baserev="ed9c3b12388cbd14868eb3faabe34685" xsrcmd5="08bfb4f40cb1e2de8f9cd4633bf02eb1" lsrcmd5="858204decf53f923d5574dbe6ae63b15" />
|
<linkinfo project="openSUSE:13.2" package="mysql-workbench" srcmd5="ed9c3b12388cbd14868eb3faabe34685" baserev="ed9c3b12388cbd14868eb3faabe34685" xsrcmd5="08bfb4f40cb1e2de8f9cd4633bf02eb1" lsrcmd5="858204decf53f923d5574dbe6ae63b15" />
|
||||||
<serviceinfo code="succeeded" xsrcmd5="6ec4305a8e5363e26a7f4895a0ae12d2" />
|
<serviceinfo code="succeeded" xsrcmd5="6ec4305a8e5363e26a7f4895a0ae12d2" />
|
||||||
@ -236,19 +236,19 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.POST,
|
httpretty.register_uri(httpretty.POST,
|
||||||
APIURL + "/request/261355",
|
APIURL + "/request/261355",
|
||||||
body = lambda method, uri, headers: change_request(result, method, uri, headers))
|
body=lambda method, uri, headers: change_request(result, method, uri, headers))
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/search/owner?project=openSUSE:13.2:Update&binary=mysql-workbench",
|
APIURL + "/search/owner?project=openSUSE:13.2:Update&binary=mysql-workbench",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<collection/>
|
<collection/>
|
||||||
""")
|
""")
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/search/owner?binary=mysql-workbench",
|
APIURL + "/search/owner?binary=mysql-workbench",
|
||||||
match_querystring = True,
|
match_querystring=True,
|
||||||
body = """
|
body="""
|
||||||
<collection>
|
<collection>
|
||||||
<owner rootproject="openSUSE" project="server:database" package="mysql-workbench">
|
<owner rootproject="openSUSE" project="server:database" package="mysql-workbench">
|
||||||
<person name="Gankov" role="maintainer"/>
|
<person name="Gankov" role="maintainer"/>
|
||||||
@ -267,7 +267,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/request',
|
APIURL + '/search/request',
|
||||||
body = """
|
body="""
|
||||||
<collection matches="1">
|
<collection matches="1">
|
||||||
<request id="261411" creator="lnussel">
|
<request id="261411" creator="lnussel">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
@ -289,7 +289,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/request/261411",
|
APIURL + "/request/261411",
|
||||||
body = """
|
body="""
|
||||||
<request id="261411" creator="lnussel">
|
<request id="261411" creator="lnussel">
|
||||||
<action type="maintenance_incident">
|
<action type="maintenance_incident">
|
||||||
<source project="home:lnussel:branches:openSUSE:Backports:SLE-12" package="plan" rev="71e76daf2c2e9ddb0b9208f54a14f608"/>
|
<source project="home:lnussel:branches:openSUSE:Backports:SLE-12" package="plan" rev="71e76daf2c2e9ddb0b9208f54a14f608"/>
|
||||||
@ -309,7 +309,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + "/source/home:lnussel:branches:openSUSE:Backports:SLE-12/plan",
|
APIURL + "/source/home:lnussel:branches:openSUSE:Backports:SLE-12/plan",
|
||||||
body = """
|
body="""
|
||||||
<directory name="plan" rev="1" vrev="1" srcmd5="b4ed19dc30c1b328168bc62a81ec6998">
|
<directory name="plan" rev="1" vrev="1" srcmd5="b4ed19dc30c1b328168bc62a81ec6998">
|
||||||
<linkinfo project="home:lnussel:plan" package="plan" srcmd5="7a2353f73b29dba970702053229542a0" baserev="7a2353f73b29dba970702053229542a0" xsrcmd5="71e76daf2c2e9ddb0b9208f54a14f608" lsrcmd5="b4ed19dc30c1b328168bc62a81ec6998" />
|
<linkinfo project="home:lnussel:plan" package="plan" srcmd5="7a2353f73b29dba970702053229542a0" baserev="7a2353f73b29dba970702053229542a0" xsrcmd5="71e76daf2c2e9ddb0b9208f54a14f608" lsrcmd5="b4ed19dc30c1b328168bc62a81ec6998" />
|
||||||
<entry name="_link" md5="91f81d88456818a18a7332999fb2da18" size="125" mtime="1415807350" />
|
<entry name="_link" md5="91f81d88456818a18a7332999fb2da18" size="125" mtime="1415807350" />
|
||||||
@ -320,7 +320,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.GET,
|
httpretty.register_uri(httpretty.GET,
|
||||||
APIURL + '/search/owner',
|
APIURL + '/search/owner',
|
||||||
body = """
|
body="""
|
||||||
<collection/>
|
<collection/>
|
||||||
""")
|
""")
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ class TestMaintenance(OBSLocal.TestCase):
|
|||||||
|
|
||||||
httpretty.register_uri(httpretty.POST,
|
httpretty.register_uri(httpretty.POST,
|
||||||
APIURL + "/request/261411",
|
APIURL + "/request/261411",
|
||||||
body = lambda method, uri, headers: change_request(result, method, uri, headers))
|
body=lambda method, uri, headers: change_request(result, method, uri, headers))
|
||||||
|
|
||||||
self.checker.requests = []
|
self.checker.requests = []
|
||||||
self.checker.set_request_ids_search_review()
|
self.checker.set_request_ids_search_review()
|
||||||
|
@ -163,7 +163,7 @@ class TestSLESubmitRequest(OBSLocal.TestCase):
|
|||||||
groups = ['sle-release-managers', 'origin-reviewers', 'autobuild-team']
|
groups = ['sle-release-managers', 'origin-reviewers', 'autobuild-team']
|
||||||
for group in groups:
|
for group in groups:
|
||||||
self.wf.create_group(group, users=[HUMAN_REVIEWER])
|
self.wf.create_group(group, users=[HUMAN_REVIEWER])
|
||||||
self.project().add_reviewers(groups = [group])
|
self.project().add_reviewers(groups=[group])
|
||||||
|
|
||||||
def __config_origin_manager(self):
|
def __config_origin_manager(self):
|
||||||
"""Creates the very minimal configuration needed by origin-manager to work"""
|
"""Creates the very minimal configuration needed by origin-manager to work"""
|
||||||
@ -186,7 +186,7 @@ class TestSLESubmitRequest(OBSLocal.TestCase):
|
|||||||
for simplicity (the rest of the execution of the bot still takes place normally).
|
for simplicity (the rest of the execution of the bot still takes place normally).
|
||||||
"""
|
"""
|
||||||
bot = self.review_bots['sle-changelog-checker']
|
bot = self.review_bots['sle-changelog-checker']
|
||||||
bot.checkTagInRequest = MagicMock(return_value = True)
|
bot.checkTagInRequest = MagicMock(return_value=True)
|
||||||
|
|
||||||
def __mock_licensedigger(self):
|
def __mock_licensedigger(self):
|
||||||
"""Mocks the execution of the LegalAuto bot, so it always succeeds and accepts the review
|
"""Mocks the execution of the LegalAuto bot, so it always succeeds and accepts the review
|
||||||
@ -201,6 +201,6 @@ class TestSLESubmitRequest(OBSLocal.TestCase):
|
|||||||
def __accept_license(self):
|
def __accept_license(self):
|
||||||
"""See :func:`__mock_licensedigger`"""
|
"""See :func:`__mock_licensedigger`"""
|
||||||
change_review_state(
|
change_review_state(
|
||||||
apiurl = self.wf.apiurl, reqid = self.request.reqid,
|
apiurl=self.wf.apiurl, reqid=self.request.reqid,
|
||||||
newstate = 'accepted', by_user='licensedigger'
|
newstate='accepted', by_user='licensedigger'
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user