aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/tests.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-11-05 15:38:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:18 +0000
commit796e3481ada98df0532bbb6607d0879f658b0b85 (patch)
tree277cdca899854066fa34158382b5fd4b098ce614 /bitbake/lib/toaster/toastergui/tests.py
parent04d8c9456465d1d7c9e6e0c7e9768714051f0b25 (diff)
downloadopenembedded-core-contrib-796e3481ada98df0532bbb6607d0879f658b0b85.tar.gz
bitbake: toaster: toastergui tests Add unit test for download custom recipe
Add unit test to test downloading end point and the basic content of the custom recipe that is generated. (Bitbake rev: 1e78d1ca2f5b02d80ab037c6f5f81d18195fc817) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tests.py')
-rw-r--r--bitbake/lib/toaster/toastergui/tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py
index 0c7829c2b3..d85498d099 100644
--- a/bitbake/lib/toaster/toastergui/tests.py
+++ b/bitbake/lib/toaster/toastergui/tests.py
@@ -114,6 +114,7 @@ class ViewTests(TestCase):
project=self.project,
layer_source=layersrc,
commit="master",
+ dirpath="/tmp/",
up_branch=branch)
lver_two = Layer_Version.objects.create(layer=layer_two,
@@ -130,6 +131,8 @@ class ViewTests(TestCase):
section="h section",
layer_version=lver_two)
+ # Create a dummy recipe file for the custom image generation to read
+ open("/tmp/my_recipe.bb", 'wa').close()
self.recipe1 = Recipe.objects.create(layer_source=layersrc,
name="base-recipe",
version="1.2",
@@ -137,7 +140,8 @@ class ViewTests(TestCase):
description="recipe",
section="A section",
license="Apache",
- layer_version=self.lver)
+ layer_version=self.lver,
+ file_path="my_recipe.bb")
Machine.objects.create(layer_version=self.lver, name="wisk",
description="wisking machine")
@@ -434,6 +438,14 @@ class ViewTests(TestCase):
self.assertNotEqual(json.loads(response.content),
{"error": "ok"})
+ def test_download_custom_recipe(self):
+ response = self.client.get(reverse('customrecipedownload',
+ args=(self.project.id,
+ self.customr.id)))
+
+ self.assertEqual(response.status_code, 200)
+
+
def test_software_recipes_table(self):
"""Test structure returned for Software RecipesTable"""
table = SoftwareRecipesTable()