From patchwork Wed May 25 21:01:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Westby X-Patchwork-Id: 1624 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:53:38 -0000 Delivered-To: patches@linaro.org Received: by 10.52.181.230 with SMTP id dz6cs252239vdc; Wed, 25 May 2011 14:01:28 -0700 (PDT) Received: by 10.227.200.3 with SMTP id eu3mr19021wbb.94.1306357287255; Wed, 25 May 2011 14:01:27 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id m11si21211weq.41.2011.05.25.14.01.26; Wed, 25 May 2011 14:01:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QPLCn-00008K-Md for ; Wed, 25 May 2011 21:01:26 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id CC0DF2E8955 for ; Wed, 25 May 2011 21:01:24 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 348 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 348: Fix the logging output in linaro-hwpack-create. Message-Id: <20110525210124.10110.99031.launchpad@loganberry.canonical.com> Date: Wed, 25 May 2011 21:01:24 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13085"; Instance="initZopeless config overlay" X-Launchpad-Hash: b60e29836e0179a4a10da9c9c2756b2989e27f59 Merge authors: James Westby (james-w) Related merge proposals: https://code.launchpad.net/~james-w/linaro-image-tools/fix-logging/+merge/62333 proposed by: James Westby (james-w) review: Approve - Mattias Backman (mabac) ------------------------------------------------------------ revno: 348 [merge] committer: James Westby branch nick: trunk timestamp: Wed 2011-05-25 17:00:02 -0400 message: Fix the logging output in linaro-hwpack-create. modified: linaro-hwpack-create linaro_image_tools/hwpack/tests/test_script.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro-hwpack-create' --- linaro-hwpack-create 2011-03-23 22:25:10 +0000 +++ linaro-hwpack-create 2011-05-25 15:47:02 +0000 @@ -48,7 +48,7 @@ ch.setLevel(logging.INFO) formatter = logging.Formatter("%(message)s") ch.setFormatter(formatter) - logger = logging.getLogger("hwpack") + logger = logging.getLogger("linaro_image_tools") logger.setLevel(logging.INFO) logger.addHandler(ch) if args.debug: === modified file 'linaro_image_tools/hwpack/tests/test_script.py' --- linaro_image_tools/hwpack/tests/test_script.py 2011-03-24 11:14:44 +0000 +++ linaro_image_tools/hwpack/tests/test_script.py 2011-05-25 17:43:12 +0000 @@ -19,8 +19,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. +import doctest import subprocess +from testtools.matchers import DocTestMatches + from linaro_image_tools.hwpack.hardwarepack import Metadata from linaro_image_tools.hwpack.testing import ( AptSourceFixture, @@ -89,3 +92,21 @@ metadata, [available_package], {"ubuntu": source.sources_entry}, package_spec=package_name)) + + def test_log_output(self): + package_name = 'foo' + architecture = 'armel' + available_package = DummyFetchedPackage( + package_name, "1.1", architecture=architecture) + source = self.useFixture(AptSourceFixture([available_package])) + config = self.useFixture(ConfigFileFixture( + '[hwpack]\nname=ahwpack\npackages=%s\narchitectures=armel\n' + '\n[ubuntu]\nsources-entry=%s\n' % ( + package_name, source.sources_entry))) + stdout, stderr = self.run_script([config.filename, "1.0"]) + self.assertThat( + stderr, + DocTestMatches( + "Building for %(arch)s\nFetching packages\n" + "Wrote hwpack_ahwpack_1.0_%(arch)s.tar.gz" + "\n" % dict(arch=architecture)))