Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 1ADB2E00FA7; Fri, 2 Oct 2015 10:48:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.88 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id B25CBE00D74 for ; Fri, 2 Oct 2015 10:47:59 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 02 Oct 2015 10:47:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,624,1437462000"; d="scan'208";a="802341305" Received: from mhalasin-mobl.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.25.78]) by fmsmga001.fm.intel.com with ESMTP; 02 Oct 2015 10:47:07 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 2 Oct 2015 18:46:47 +0100 Message-Id: <1443808009-5017-8-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1443808009-5017-1-git-send-email-elliot.smith@intel.com> References: <1443808009-5017-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 7/9] toaster: More linting of tests X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2015 17:48:01 -0000 Fix some more lint errors on the tests for toastergui. Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/tests.py | 35 +++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 9769713..a646153 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py @@ -433,6 +433,18 @@ class AllProjectsPageTests(TestCase): MACHINE_NAME = 'delorean' + def setUp(self): + """ Add default project manually """ + project = Project.objects.create_project(CLI_BUILDS_PROJECT_NAME, None) + self.default_project = project + self.default_project.is_default = True + self.default_project.save() + + # this project is only set for some of the tests + self.project = None + + self.release = None + def _add_build_to_default_project(self): """ Add a build to the default project (not used in all tests) """ now = timezone.now() @@ -458,16 +470,6 @@ class AllProjectsPageTests(TestCase): value=self.MACHINE_NAME) project_var.save() - def setUp(self): - """ Add default project manually """ - project = Project.objects.create_project(CLI_BUILDS_PROJECT_NAME, None) - self.default_project = project - self.default_project.is_default = True - self.default_project.save() - - # this project is only set for some of the tests - self.project = None - def test_default_project_hidden(self): """ The default project should be hidden if it has no builds """ params = {"count": 10, "orderby": "updated:-", "page": 1} @@ -573,17 +575,15 @@ class AllProjectsPageTests(TestCase): # link for default project row = soup.find('tr', attrs={'data-project': self.default_project.id}) cell = row.find('td', attrs={'data-project-field': 'name'}) - url = cell.find('a')['href'] expected_url = reverse('projectbuilds', args=(self.default_project.id,)) - self.assertEqual(url, expected_url, + self.assertEqual(cell.find('a')['href'], expected_url, 'link on default project name should point to builds') # link for other project row = soup.find('tr', attrs={'data-project': self.project.id}) cell = row.find('td', attrs={'data-project-field': 'name'}) - url = cell.find('a')['href'] expected_url = reverse('project', args=(self.project.id,)) - self.assertEqual(url, expected_url, + self.assertEqual(cell.find('a')['href'], expected_url, 'link on project name should point to configuration') class ProjectBuildsPageTests(TestCase): @@ -640,13 +640,6 @@ class ProjectBuildsPageTests(TestCase): "outcome": Build.IN_PROGRESS } - self.default_project_build_success = { - "project": self.default_project, - "started_on": now, - "completed_on": now, - "outcome": Build.SUCCEEDED - } - def _get_rows_for_project(self, project_id): """ Helper to retrieve HTML rows for a project """ url = reverse("projectbuilds", args=(project_id,)) -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.