diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-10-02 11:05:15 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-12 14:38:55 +0100 |
commit | 0fb6be01feac7e4d63cb3696bf2d182b3e85bbca (patch) | |
tree | b7ee742870789d1f9ee98ce2ff04aec1164a880e | |
parent | dea679af1a068089080f517a9522ed39c65fcaef (diff) | |
download | poky-0fb6be01feac7e4d63cb3696bf2d182b3e85bbca.tar.gz |
bitbake: toaster: fix orm tests
Cleaned up and fixed orm tests. Removed test_build_layerversion as
it's not needed due to changed compatible_layer_versions API.
(Bitbake rev: 73ea29ed065bfaa80ee368b2a38c157e36fe1676)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/toaster/orm/tests.py | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/bitbake/lib/toaster/orm/tests.py b/bitbake/lib/toaster/orm/tests.py index 783aea890f..c30f99a3af 100644 --- a/bitbake/lib/toaster/orm/tests.py +++ b/bitbake/lib/toaster/orm/tests.py | |||
@@ -25,10 +25,9 @@ from django.test import TestCase, TransactionTestCase | |||
25 | from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource | 25 | from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource |
26 | from orm.models import Branch | 26 | from orm.models import Branch |
27 | 27 | ||
28 | from orm.models import Project, Build, Layer, Layer_Version, Branch, ProjectLayer | 28 | from orm.models import Project, Layer, Layer_Version, Branch, ProjectLayer |
29 | from orm.models import Release, ReleaseLayerSourcePriority, BitbakeVersion | 29 | from orm.models import Release, ReleaseLayerSourcePriority, BitbakeVersion |
30 | 30 | ||
31 | from django.utils import timezone | ||
32 | from django.db import IntegrityError | 31 | from django.db import IntegrityError |
33 | 32 | ||
34 | import os | 33 | import os |
@@ -153,35 +152,11 @@ class LayerVersionEquivalenceTestCase(TestCase): | |||
153 | equivqs = self.lver.get_equivalents_wpriority(self.project) | 152 | equivqs = self.lver.get_equivalents_wpriority(self.project) |
154 | self.assertEqual(list(equivqs), [lver2, self.lver]) | 153 | self.assertEqual(list(equivqs), [lver2, self.lver]) |
155 | 154 | ||
156 | def test_build_layerversion(self): | 155 | def test_compatible_layer_versions(self): |
157 | """ | 156 | """ |
158 | Any layer version coming from the build should show up | 157 | When we have a 2 layer versions, get_all_compatible_layerversions() |
159 | before any layer version coming from upstream | ||
160 | """ | ||
161 | build = Build.objects.create(project=self.project, | ||
162 | started_on=timezone.now(), | ||
163 | completed_on=timezone.now()) | ||
164 | lvb = Layer_Version.objects.create(layer=self.layer, build=build, | ||
165 | commit="deadbeef") | ||
166 | |||
167 | # a build layerversion must be in the equivalence | ||
168 | # list for the original layerversion | ||
169 | equivqs = self.lver.get_equivalents_wpriority(self.project) | ||
170 | self.assertTrue(len(equivqs) == 2) | ||
171 | self.assertTrue(equivqs[0] == self.lver) | ||
172 | self.assertTrue(equivqs[1] == lvb) | ||
173 | |||
174 | # getting the build layerversion equivalent list must | ||
175 | # return the same list as the original layer | ||
176 | bequivqs = lvb.get_equivalents_wpriority(self.project) | ||
177 | |||
178 | self.assertEqual(list(equivqs), list(bequivqs)) | ||
179 | |||
180 | def test_compatible_layerversions(self): | ||
181 | """ | ||
182 | When we have a 2 layer versions, compatible_layerversions() | ||
183 | should return a queryset with both. | 158 | should return a queryset with both. |
184 | """ | 159 | """ |
185 | compat_lv = self.project.compatible_layerversions() | 160 | compat_lv = self.project.get_all_compatible_layer_versions() |
186 | self.assertEqual(list(compat_lv), [self.lver, self.lver2]) | 161 | self.assertEqual(list(compat_lv), [self.lver, self.lver2]) |
187 | 162 | ||