diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-08-10 12:21:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-17 14:41:45 +0100 |
commit | c348fa50186fb0796bc7b793c4b8d710419f2a0d (patch) | |
tree | 3801f011aec67c1006faa743b4aa79955f2416ef /bitbake/lib | |
parent | e5956a6b850f75e65a76180fc7a568553072d36d (diff) | |
download | poky-c348fa50186fb0796bc7b793c4b8d710419f2a0d.tar.gz |
bitbake: toaster: move code from setup_lv_tests to setUp
As ProjectLVSelectionTestCase was removed there is no point
to keep this function. Moved code back to setUp method.
(Bitbake rev: 8e9bd559c8ef0ebc9e8babbada06e710908bae08)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/orm/tests.py | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/bitbake/lib/toaster/orm/tests.py b/bitbake/lib/toaster/orm/tests.py index 5246909ae5..783aea890f 100644 --- a/bitbake/lib/toaster/orm/tests.py +++ b/bitbake/lib/toaster/orm/tests.py | |||
@@ -81,40 +81,37 @@ class LILSUpdateTestCase(TransactionTestCase): | |||
81 | self.assertTrue(lsobj.branch_set.all().count() > 0, | 81 | self.assertTrue(lsobj.branch_set.all().count() > 0, |
82 | "no branches fetched") | 82 | "no branches fetched") |
83 | 83 | ||
84 | |||
85 | def setup_lv_tests(self): | ||
86 | """Create required objects.""" | ||
87 | # create layer source | ||
88 | self.lsrc = LayerSource.objects.create(name="dummy-layersource", | ||
89 | sourcetype=LayerSource.TYPE_LOCAL) | ||
90 | # create release | ||
91 | bbv = BitbakeVersion.objects.create(\ | ||
92 | name="master", giturl="git://git.openembedded.org/bitbake") | ||
93 | self.release = Release.objects.create(name="default-release", | ||
94 | bitbake_version=bbv, | ||
95 | branch_name="master") | ||
96 | # attach layer source to release | ||
97 | ReleaseLayerSourcePriority.objects.create(\ | ||
98 | release=self.release, layer_source=self.lsrc, priority=1) | ||
99 | |||
100 | # create a layer version for the layer on the specified branch | ||
101 | self.layer = Layer.objects.create(name="meta-testlayer", | ||
102 | layer_source=self.lsrc) | ||
103 | self.branch = Branch.objects.create(name="master", layer_source=self.lsrc) | ||
104 | self.lver = Layer_Version.objects.create(\ | ||
105 | layer=self.layer, layer_source=self.lsrc, up_branch=self.branch) | ||
106 | |||
107 | # create project and project layer | ||
108 | self.project = Project.objects.create_project(name="test-project", | ||
109 | release=self.release) | ||
110 | ProjectLayer.objects.create(project=self.project, | ||
111 | layercommit=self.lver) | ||
112 | |||
113 | class LayerVersionEquivalenceTestCase(TestCase): | 84 | class LayerVersionEquivalenceTestCase(TestCase): |
114 | """Verify Layer_Version priority selection.""" | 85 | """Verify Layer_Version priority selection.""" |
115 | 86 | ||
116 | def setUp(self): | 87 | def setUp(self): |
117 | setup_lv_tests(self) | 88 | """Create required objects.""" |
89 | # create layer source | ||
90 | self.lsrc = LayerSource.objects.create(name="dummy-layersource", | ||
91 | sourcetype=LayerSource.TYPE_LOCAL) | ||
92 | # create release | ||
93 | bbv = BitbakeVersion.objects.create(\ | ||
94 | name="master", giturl="git://git.openembedded.org/bitbake") | ||
95 | self.release = Release.objects.create(name="default-release", | ||
96 | bitbake_version=bbv, | ||
97 | branch_name="master") | ||
98 | # attach layer source to release | ||
99 | ReleaseLayerSourcePriority.objects.create(\ | ||
100 | release=self.release, layer_source=self.lsrc, priority=1) | ||
101 | |||
102 | # create a layer version for the layer on the specified branch | ||
103 | self.layer = Layer.objects.create(name="meta-testlayer", | ||
104 | layer_source=self.lsrc) | ||
105 | self.branch = Branch.objects.create(name="master", layer_source=self.lsrc) | ||
106 | self.lver = Layer_Version.objects.create(\ | ||
107 | layer=self.layer, layer_source=self.lsrc, up_branch=self.branch) | ||
108 | |||
109 | # create project and project layer | ||
110 | self.project = Project.objects.create_project(name="test-project", | ||
111 | release=self.release) | ||
112 | ProjectLayer.objects.create(project=self.project, | ||
113 | layercommit=self.lver) | ||
114 | |||
118 | # create spoof layer that should not appear in the search results | 115 | # create spoof layer that should not appear in the search results |
119 | layer = Layer.objects.create(name="meta-notvalid", | 116 | layer = Layer.objects.create(name="meta-notvalid", |
120 | layer_source=self.lsrc) | 117 | layer_source=self.lsrc) |