From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id BF449E00707; Sat, 8 Aug 2015 10:46:46 -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 238A2E00343 for ; Sat, 8 Aug 2015 10:46:43 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 08 Aug 2015 10:46:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,634,1432623600"; d="scan'208";a="780338070" Received: from linux.intel.com ([10.23.219.25]) by orsmga002.jf.intel.com with ESMTP; 08 Aug 2015 10:46:43 -0700 Received: from linux.intel.com (vmed.fi.intel.com [10.237.72.65]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTP id 1053F6A4005; Sat, 8 Aug 2015 10:45:55 -0700 (PDT) Date: Sat, 8 Aug 2015 20:46:38 +0300 From: Ed Bartosh To: Sujith H Message-ID: <20150808174638.GA8925@linux.intel.com> References: <1438875688-16222-1-git-send-email-sujith.h@gmail.com> MIME-Version: 1.0 In-Reply-To: <1438875688-16222-1-git-send-email-sujith.h@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Cc: toaster@yoctoproject.org Subject: Re: [review-request][PATCH][v2] toastergui: Add tests for xhr_importlayer X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: ed.bartosh@linux.intel.com List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Aug 2015 17:46:46 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Sujith, Can you rebase your patch on top of ed/toaster/fix-toastergui-tests? And please check that your code doesn't bring new pylint warnings. I'm running pylint this way: pylint --load-plugins pylint_django toastergui/tests.py And it's scores for tests.py code is 10. On Thu, Aug 06, 2015 at 09:11:28PM +0530, Sujith H wrote: > From: Sujith Haridasan > > Inorder to make sure if layer name which we import is already > available in toaster database, a test case has been included. > This would help user to identify if layer name which has been > provided in the import layer web page already exists or not. > > Signed-off-by: Sujith Haridasan > Signed-off-by: Sujith Haridasan > --- > bitbake/lib/toaster/toastergui/tests.py | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py > index 77e80fe..9e444ae 100644 > --- a/bitbake/lib/toaster/toastergui/tests.py > +++ b/bitbake/lib/toaster/toastergui/tests.py > @@ -75,3 +75,34 @@ class XHRDataTypeAheadTestCase(ProvisionedLayersProjectTestCase): > self.assertTrue(len(data["list"]) > 0) > > self.assertTrue(XHRDataTypeAheadTestCase.LAYER_NAME in map(lambda x: x["name"], data["list"])) > + > + > +class XHRImportLayerTestCase(ProvisionedLayersProjectTestCase): > + > + def setUp(self): > + super(XHRImportLayerTestCase, self).setUp() > + self.assertTrue(self.lv in self.project.compatible_layerversions()) > + > + def test_import(self): > + #Test for importing an already existing layer > + data = {'vcs_url' : "git://git.example.com/test" , > + 'name' : "base-layer", 'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce", > + 'project_id': 1, 'dir_path' : "/path/in/repository"} > + result = self.client.post(reverse('xhr_importlayer'), data) > + self.assertEqual(result.status_code,200) > + self.assertTrue("hint-layer-exists-with-different-url" in result.content) > + > + #Test to verify import of a layer successful > + data['name'] = "meta-oe" > + result = self.client.post(reverse('xhr_importlayer'), data) > + self.assertTrue('"error": "ok"' in result.content) > + > + #Test for html tag in the data > + data['<'] = "testing html tag" > + result = self.client.post(reverse('xhr_importlayer'), data) > + self.assertTrue('"error": "Invalid character <"' in result.content) > + > + #Empty data passed > + data = {} > + result = self.client.post(reverse('xhr_importlayer'), data) > + self.assertTrue('"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"' in result.content) > -- > 1.9.1 > > -- > _______________________________________________ > toaster mailing list > toaster@yoctoproject.org > https://lists.yoctoproject.org/listinfo/toaster -- -- Regards, Ed