From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5CB35E00A7D; Wed, 12 Aug 2015 04:17:37 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.169 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 95029E00A26 for ; Wed, 12 Aug 2015 04:17:33 -0700 (PDT) Received: by wibhh20 with SMTP id hh20so23657866wib.0 for ; Wed, 12 Aug 2015 04:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=vlGJIQSumdJF+mug1+wiuk0QbUM/y6ENN/b3m9TW8RI=; b=CCoKVixK7RGZIgT4ug+U9FeiA6nbZmETwWFq2b79o3kRLDN3EeQHtqNxujQF5J5nxi rJK6gy5+mtE2Qf2TwPQgjnidMiIcqin1FOiGnccakRWLL3c6T+W+g3hErstvsBwvbik6 JQ8WvL5stX3TfbfWHw7UBybcnKHW22Nggt995CGpbzwrTSSCs+HCpOB5AtpBXGsQ3d4r QOA/fc7YTF/7XtNrjsWjQOHiGcmY67m0LPjDvni96kQwlMmVHWUJBbaSPeDLUlWmeuuo R26sEfosAKnuUAU7qkzQwW978fPsLADflWCiLgGwcwXNDO5mAJsagRaJbo4+yv+EAzRz ISAA== X-Gm-Message-State: ALoCoQnFbyscW5Ah2lU1zuIMKQeSCqiTgvuw4oPof8hOfe9JfFx/ZYTWNv4KOsMm+kb+VOVV5eP5 X-Received: by 10.194.121.131 with SMTP id lk3mr64364205wjb.77.1439378252632; Wed, 12 Aug 2015 04:17:32 -0700 (PDT) Received: from [192.168.2.117] ([83.217.123.106]) by smtp.googlemail.com with ESMTPSA id q19sm7829820wik.16.2015.08.12.04.17.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Aug 2015 04:17:32 -0700 (PDT) Message-ID: <55CB2B4B.5060806@intel.com> Date: Wed, 12 Aug 2015 12:17:31 +0100 From: Michael Wood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: toaster@yoctoproject.org References: <1439278186-6357-1-git-send-email-sujith.h@gmail.com> In-Reply-To: <1439278186-6357-1-git-send-email-sujith.h@gmail.com> Subject: Re: [review-request][PATCH][v3] toastergui: Add tests for xhr_importlayer 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: Wed, 12 Aug 2015 11:17:37 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Thanks Sujith, patch submitted to bitbake. On 11/08/15 08:29, Sujith H wrote: > 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 | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py > index 93a85ac..85e27fe 100644 > --- a/bitbake/lib/toaster/toastergui/tests.py > +++ b/bitbake/lib/toaster/toastergui/tests.py > @@ -148,3 +148,33 @@ class ViewTests(TestCase): > # After "typeing" the alpabet we should have result true > # from each of the urls > self.assertTrue(results) > + > + def test_xhr_import_layer(self): > + """Test xhr_importlayer API""" > + #Test for importing an already existing layer > + args = {'vcs_url' : "git://git.example.com/test", > + 'name' : "base-layer", > + 'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce", > + 'project_id': 1, 'dir_path' : "/path/in/repository"} > + response = self.client.post(reverse('xhr_importlayer'), args) > + data = json.loads(response.content) > + self.assertEqual(response.status_code, 200) > + self.assertNotEqual(data["error"], "ok") > + > + #Test to verify import of a layer successful > + args['name'] = "meta-oe" > + response = self.client.post(reverse('xhr_importlayer'), args) > + data = json.loads(response.content) > + self.assertTrue(data["error"], "ok") > + > + #Test for html tag in the data > + args['<'] = "testing html tag" > + response = self.client.post(reverse('xhr_importlayer'), args) > + data = json.loads(response.content) > + self.assertNotEqual(data["error"], "ok") > + > + #Empty data passed > + args = {} > + response = self.client.post(reverse('xhr_importlayer'), args) > + data = json.loads(response.content) > + self.assertNotEqual(data["error"], "ok")