From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Sujith H <sujith.h@gmail.com>
Cc: toaster@yoctoproject.org
Subject: Re: [review-request][PATCH][v2] toastergui: Add tests for xhr_importlayer
Date: Sat, 8 Aug 2015 20:46:38 +0300 [thread overview]
Message-ID: <20150808174638.GA8925@linux.intel.com> (raw)
In-Reply-To: <1438875688-16222-1-git-send-email-sujith.h@gmail.com>
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 <Sujith_Haridasan@mentor.com>
>
> 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 | 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
next prev parent reply other threads:[~2015-08-08 17:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 15:41 [review-request][PATCH][v2] toastergui: Add tests for xhr_importlayer Sujith H
2015-08-06 15:43 ` sujith h
2015-08-08 17:46 ` Ed Bartosh [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-08-10 9:03 Sujith H
2015-08-10 9:06 ` sujith h
2015-08-10 16:26 ` Ed Bartosh
2015-08-11 7:26 ` 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=20150808174638.GA8925@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=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.