From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 37C64E0086D; Wed, 5 Aug 2015 05:57:39 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (sujith.h[at]gmail.com) * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.53 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's * domain * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id ED34DE005A2 for ; Wed, 5 Aug 2015 05:57:35 -0700 (PDT) Received: by pacrr5 with SMTP id rr5so784607pac.3 for ; Wed, 05 Aug 2015 05:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=U2u5vzkLQWEFNhZGD+aBDx9W+R6GmS/OvSSUvSAsMiA=; b=W0pgaQawD23wBS0yBWMPv4sBQ+P+cPZJmNE7wM1678x41K9i5kcqGT7DPHX1PocW0a +NFplEMJ9M59wAzFBznkIlGNR6MAOf3BvvC9ua06/aEYvtTck4ELGJrwxc4Zbd5V1G5T AIWGxCAkaHW81sVJtYx52L1PLvsfB4VNohhl7gtPy+rsPxlDlJhFNEISV4ZLQP6I4t7F Z8qdDHexZuo5Psgss0zeBFcB33lIj5gOftW8Id0MFY7VkXfMFu0Uq6JB+LknY82vgpEB lmfgnxBElSIHEQ85Hwnp92ZDvvK28x7BejnypnEImGjMJKA7MUJmNYNeIb3CJxI1uHWL xntw== X-Received: by 10.66.176.161 with SMTP id cj1mr19105312pac.24.1438779455049; Wed, 05 Aug 2015 05:57:35 -0700 (PDT) Received: from kdekidd0.inp.mentorg.com ([139.181.35.34]) by smtp.gmail.com with ESMTPSA id xv1sm2875516pbb.25.2015.08.05.05.57.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 05:57:34 -0700 (PDT) From: Sujith H To: toaster@yoctoproject.org Date: Wed, 5 Aug 2015 18:27:27 +0530 Message-Id: <1438779447-30786-1-git-send-email-sujith.h@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [review-request][PATCH] 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, 05 Aug 2015 12:57:39 -0000 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 77e80fe..c4db145 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py @@ -75,3 +75,21 @@ 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): + data = {'vcs_url' : "/home/sujith/MEL/toaster_work/meta-oe" , + 'name' : "base-layer", 'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce", + 'project_id': 1, 'dir_path' : "/home/sujith/MEL/toaster_work/meta-oe/meta-oe"} + result = self.client.post(reverse('xhr_importlayer'), data, HTTP_X_REQUESTED_WITH='XMLHttpRequest') + self.assertEqual(result.status_code,200) + self.assertTrue("hint-layer-exists-with-different-url" in result.content) + data['name'] = "meta-oe" + result = self.client.post(reverse('xhr_importlayer'), data, HTTP_X_REQUESTED_WITH='XMLHttpRequest') + self.assertTrue('"error": "ok"' in result.content) -- 1.9.1