mirror of
https://git.yoctoproject.org/poky
synced 2026-09-29 07:36:20 +02:00
bitbake: toaster: rewrite LILSUpdateTestCase
Reformatted code. Added docstings. (Bitbake rev: 0d1a9038b0cface75d3c858543e411f519b4ef5e) 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>
This commit is contained in:
committed by
Richard Purdie
parent
344ad2e128
commit
d637b91639
@@ -37,22 +37,26 @@ class LayerSourceVerifyInheritanceSaveLoad(TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class LILSUpdateTestCase(TransactionTestCase):
|
class LILSUpdateTestCase(TransactionTestCase):
|
||||||
|
"""Test Layer Source update."""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
# create release
|
"""Create release."""
|
||||||
bbv = BitbakeVersion.objects.create(name="master", giturl="git://git.openembedded.org/bitbake")
|
bbv = BitbakeVersion.objects.create(\
|
||||||
release = Release.objects.create(name="default-release", bitbake_version = bbv, branch_name = "master")
|
name="master", giturl="git://git.openembedded.org/bitbake")
|
||||||
|
Release.objects.create(name="default-release", bitbake_version=bbv,
|
||||||
|
branch_name="master")
|
||||||
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
layer_index_url = os.getenv("TTS_LAYER_INDEX")
|
"""Check if LayerSource.update can fetch branches."""
|
||||||
if layer_index_url == None:
|
url = os.getenv("TTS_LAYER_INDEX",
|
||||||
layer_index_url = "http://layers.openembedded.org/"
|
default="http://layers.openembedded.org/")
|
||||||
|
|
||||||
lils = LayerSource.objects.create(name = "b1", sourcetype = LayerSource.TYPE_LAYERINDEX, apiurl = layer_index_url + "layerindex/api/")
|
|
||||||
lils.update()
|
|
||||||
|
|
||||||
# run asserts
|
|
||||||
self.assertTrue(lils.branch_set.all().count() > 0, "update() needs to fetch some branches")
|
|
||||||
|
|
||||||
|
lsobj = LayerSource.objects.create(\
|
||||||
|
name="b1", sourcetype=LayerSource.TYPE_LAYERINDEX,
|
||||||
|
apiurl=url + "layerindex/api/")
|
||||||
|
lsobj.update()
|
||||||
|
self.assertTrue(lsobj.branch_set.all().count() > 0,
|
||||||
|
"no branches fetched")
|
||||||
|
|
||||||
|
|
||||||
# tests to verify layer_version priority selection
|
# tests to verify layer_version priority selection
|
||||||
|
|||||||
Reference in New Issue
Block a user