summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/orm/tests.py')
-rw-r--r--bitbake/lib/toaster/orm/tests.py30
1 files changed, 17 insertions, 13 deletions
diff --git a/bitbake/lib/toaster/orm/tests.py b/bitbake/lib/toaster/orm/tests.py
index b0c01db216..3384f01c39 100644
--- a/bitbake/lib/toaster/orm/tests.py
+++ b/bitbake/lib/toaster/orm/tests.py
@@ -37,22 +37,26 @@ class LayerSourceVerifyInheritanceSaveLoad(TestCase):
37 37
38 38
39class LILSUpdateTestCase(TransactionTestCase): 39class LILSUpdateTestCase(TransactionTestCase):
40 """Test Layer Source update."""
41
40 def setUp(self): 42 def setUp(self):
41 # create release 43 """Create release."""
42 bbv = BitbakeVersion.objects.create(name="master", giturl="git://git.openembedded.org/bitbake") 44 bbv = BitbakeVersion.objects.create(\
43 release = Release.objects.create(name="default-release", bitbake_version = bbv, branch_name = "master") 45 name="master", giturl="git://git.openembedded.org/bitbake")
46 Release.objects.create(name="default-release", bitbake_version=bbv,
47 branch_name="master")
44 48
45 def test_update(self): 49 def test_update(self):
46 layer_index_url = os.getenv("TTS_LAYER_INDEX") 50 """Check if LayerSource.update can fetch branches."""
47 if layer_index_url == None: 51 url = os.getenv("TTS_LAYER_INDEX",
48 layer_index_url = "http://layers.openembedded.org/" 52 default="http://layers.openembedded.org/")
49 53
50 lils = LayerSource.objects.create(name = "b1", sourcetype = LayerSource.TYPE_LAYERINDEX, apiurl = layer_index_url + "layerindex/api/") 54 lsobj = LayerSource.objects.create(\
51 lils.update() 55 name="b1", sourcetype=LayerSource.TYPE_LAYERINDEX,
52 56 apiurl=url + "layerindex/api/")
53 # run asserts 57 lsobj.update()
54 self.assertTrue(lils.branch_set.all().count() > 0, "update() needs to fetch some branches") 58 self.assertTrue(lsobj.branch_set.all().count() > 0,
55 59 "no branches fetched")
56 60
57 61
58# tests to verify layer_version priority selection 62# tests to verify layer_version priority selection