diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-08-10 12:21:27 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-17 14:41:42 +0100 |
| commit | d637b91639fcae376b88319b0f38b3f92cd4c723 (patch) | |
| tree | d2733cc5b727d7debe7845b369e3ea93ea0f11e0 /bitbake/lib/toaster/orm/tests.py | |
| parent | 344ad2e1283134600111e3d5647d0ffba33bec74 (diff) | |
| download | poky-d637b91639fcae376b88319b0f38b3f92cd4c723.tar.gz | |
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>
Diffstat (limited to 'bitbake/lib/toaster/orm/tests.py')
| -rw-r--r-- | bitbake/lib/toaster/orm/tests.py | 30 |
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 | ||
| 39 | class LILSUpdateTestCase(TransactionTestCase): | 39 | class 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 |
