diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-11-05 15:38:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-10 13:29:18 +0000 |
commit | 796e3481ada98df0532bbb6607d0879f658b0b85 (patch) | |
tree | 277cdca899854066fa34158382b5fd4b098ce614 /bitbake/lib/toaster/toastergui/tests.py | |
parent | 04d8c9456465d1d7c9e6e0c7e9768714051f0b25 (diff) | |
download | poky-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.py | 14 |
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): | |||
114 | project=self.project, | 114 | project=self.project, |
115 | layer_source=layersrc, | 115 | layer_source=layersrc, |
116 | commit="master", | 116 | commit="master", |
117 | dirpath="/tmp/", | ||
117 | up_branch=branch) | 118 | up_branch=branch) |
118 | 119 | ||
119 | lver_two = Layer_Version.objects.create(layer=layer_two, | 120 | lver_two = Layer_Version.objects.create(layer=layer_two, |
@@ -130,6 +131,8 @@ class ViewTests(TestCase): | |||
130 | section="h section", | 131 | section="h section", |
131 | layer_version=lver_two) | 132 | layer_version=lver_two) |
132 | 133 | ||
134 | # Create a dummy recipe file for the custom image generation to read | ||
135 | open("/tmp/my_recipe.bb", 'wa').close() | ||
133 | self.recipe1 = Recipe.objects.create(layer_source=layersrc, | 136 | self.recipe1 = Recipe.objects.create(layer_source=layersrc, |
134 | name="base-recipe", | 137 | name="base-recipe", |
135 | version="1.2", | 138 | version="1.2", |
@@ -137,7 +140,8 @@ class ViewTests(TestCase): | |||
137 | description="recipe", | 140 | description="recipe", |
138 | section="A section", | 141 | section="A section", |
139 | license="Apache", | 142 | license="Apache", |
140 | layer_version=self.lver) | 143 | layer_version=self.lver, |
144 | file_path="my_recipe.bb") | ||
141 | 145 | ||
142 | Machine.objects.create(layer_version=self.lver, name="wisk", | 146 | Machine.objects.create(layer_version=self.lver, name="wisk", |
143 | description="wisking machine") | 147 | description="wisking machine") |
@@ -434,6 +438,14 @@ class ViewTests(TestCase): | |||
434 | self.assertNotEqual(json.loads(response.content), | 438 | self.assertNotEqual(json.loads(response.content), |
435 | {"error": "ok"}) | 439 | {"error": "ok"}) |
436 | 440 | ||
441 | def test_download_custom_recipe(self): | ||
442 | response = self.client.get(reverse('customrecipedownload', | ||
443 | args=(self.project.id, | ||
444 | self.customr.id))) | ||
445 | |||
446 | self.assertEqual(response.status_code, 200) | ||
447 | |||
448 | |||
437 | def test_software_recipes_table(self): | 449 | def test_software_recipes_table(self): |
438 | """Test structure returned for Software RecipesTable""" | 450 | """Test structure returned for Software RecipesTable""" |
439 | table = SoftwareRecipesTable() | 451 | table = SoftwareRecipesTable() |