From 5f01d761f46c374e08a990838d2c8602b3f4ae70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 6 Feb 2014 11:14:08 +0100 Subject: [PATCH 1/2] Document also that we want to use mock. --- tests/README.asciidoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/README.asciidoc b/tests/README.asciidoc index 5a2e067d..570b3d26 100644 --- a/tests/README.asciidoc +++ b/tests/README.asciidoc @@ -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. From dd7405f4ffbb09a57934680428151af512ff63f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 10 Feb 2014 10:19:37 +0100 Subject: [PATCH 2/2] Different year, whitespace --- osc-staging.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/osc-staging.py b/osc-staging.py index a193d6f0..e903adcb 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -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 @@ -218,7 +218,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() @@ -245,12 +245,12 @@ def _staging_create(self, trg, opts): # what are the repositories elif re.search("^\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): @@ -380,7 +380,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') @@ -470,7 +470,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)) @@ -488,7 +488,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 @@ -501,7 +501,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'): @@ -574,7 +574,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: "list" will pick the requests not in rings