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>
This commit is contained in:
parent
04d8c94564
commit
796e3481ad
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue