From: Sujith H <sujith.h@gmail.com>
To: toaster@yoctoproject.org
Subject: [review-request][PATCH] toastergui: Add tests for xhr_importlayer
Date: Wed, 5 Aug 2015 18:27:27 +0530 [thread overview]
Message-ID: <1438779447-30786-1-git-send-email-sujith.h@gmail.com> (raw)
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 <sujith.h@gmail.com>
Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
---
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
next reply other threads:[~2015-08-05 12:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 12:57 Sujith H [this message]
2015-08-06 14:42 ` [review-request][PATCH] toastergui: Add tests for xhr_importlayer Michael Wood
2015-08-06 15:01 ` sujith h
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438779447-30786-1-git-send-email-sujith.h@gmail.com \
--to=sujith.h@gmail.com \
--cc=toaster@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.