Merge pull request #4 from scarabeusiv/master

Merge whitespace & documentation cleanup
This commit is contained in:
Michal Hrušecký 2014-02-10 10:35:27 +01:00
commit cf94542e41
2 changed files with 17 additions and 17 deletions

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (C) 2013 mhrusecky@suse.cz, openSUSE.org
# (C) 2013 tchvatal@suse.cz, openSUSE.org
# (C) 2014 mhrusecky@suse.cz, openSUSE.org
# (C) 2014 tchvatal@suse.cz, openSUSE.org
# Distribute under GPLv2 or GPLv3
from osc import cmdln
@ -313,7 +313,7 @@ def _staging_create(self, trg, opts):
if re.search("^\s*[Nn]", answer):
print('Aborting...')
exit(1)
# parse metadata from parent project
trg_meta_url = make_meta_url("prj", trg_prj, opts.apiurl)
data = http_GET(trg_meta_url).readlines()
@ -340,12 +340,12 @@ def _staging_create(self, trg, opts):
# what are the repositories
elif re.search("^\s+<repository", line):
repos.append(re.sub(r'.*name="([^"]+)".*', r'\1', line).strip())
# add maintainers of source project
trg_meta_url = make_meta_url("prj", src_prj, opts.apiurl)
data = http_GET(trg_meta_url).readlines()
perm += "".join(filter((lambda x: (re.search("^\s+(<person|<group)", x) is not None)), data))
# add maintainers of source package
if src_pkg is not None:
trg_meta_url = make_meta_url("pkg", (src_prj, src_pkg), opts.apiurl)
@ -386,7 +386,7 @@ def _staging_create(self, trg, opts):
print('Linking package %s/%s -> %s/%s...'%(src_pkg,src_prj,stg_prj,trg_pkg))
link_pac(src_prj, src_pkg, stg_prj, trg_pkg, True)
print
return
def _staging_remove(self, project, opts):
@ -475,7 +475,7 @@ def _staging_one_request(self, rq, opts):
approved_actions = 0
actions = rq.findall('action')
act = actions[0]
tprj = act.find('target').get('project')
tpkg = act.find('target').get('package')
@ -565,7 +565,7 @@ def _staging_freeze_prjlink(self, prj, opts):
for lprj in self.projectlinks:
fl = ET.SubElement(flink, 'frozenlink', { 'project': lprj } )
sources = self._staging_receive_sources(lprj, sources, fl, opts)
from pprint import pprint
url = makeurl(opts.apiurl, ['source', prj, '_project', '_frozenlinks'], { 'meta': '1' } )
f = http_PUT(url, data=ET.tostring(flink))
@ -583,7 +583,7 @@ def _staging_fill_pkgdeps(self, prj, repo, arch, opts):
url = makeurl(opts.apiurl, ['build', prj, repo, arch, '_builddepinfo'])
f = http_GET(url)
root = ET.parse(f).getroot()
for package in root.findall('package'):
#print ET.tostring(package)
source = package.find('source').text
@ -596,7 +596,7 @@ def _staging_fill_pkgdeps(self, prj, repo, arch, opts):
if self.bin2src.has_key(subpkg):
print "bin $s defined twice $prj $source - $bin2src{$s}\n"
self.bin2src[subpkg] = source
for package in root.findall('package'):
source = package.find('source').text
for pkg in package.findall('pkgdep'):
@ -669,7 +669,7 @@ def do_staging(self, subcmd, opts, *args):
changes to openSUSE:Factory
"freeze" will freeze the sources of the project's links (not affecting the packages actually in)
"accept" will accept all requests openSUSE:Factory:Staging:<LETTER>
"list" will pick the requests not in rings

View File

@ -4,12 +4,12 @@ Testing
Dependencies
------------
Test suite is using +nose+ and +httpretty+ for testing. You need these tho
python modules installed to run tests. In openSUSE, you can do it using the
following command as a root:
Test suite is using +nose+, +httpretty+ and +mock+ for testing. You need these
three python modules installed to run tests. In openSUSE, you can do it using
the following command as a root:
--------------------------------------------------------------------------------
zypper in python-nose python-httpretty
zypper in python-nose python-httpretty python-mock
--------------------------------------------------------------------------------
Running tests
@ -22,8 +22,8 @@ run the following command there:
nosetests
--------------------------------------------------------------------------------
Structure
---------
Structure of the suite
----------------------
Each object is containing functions for the individual tests so split them per
area of interest.