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.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/orm/tests.py b/bitbake/lib/toaster/orm/tests.py
index f2f561bff9..b965d8e50e 100644
--- a/bitbake/lib/toaster/orm/tests.py
+++ b/bitbake/lib/toaster/orm/tests.py
@@ -1,16 +1,19 @@
1from django.test import TestCase 1from django.test import TestCase
2from orm.models import LocalLayerSource, LayerIndexLayerSource, LayerSource 2from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource
3from orm.models import Branch 3from orm.models import Branch
4 4
5class LayerSourceVerifyInheritanceSaveLoad(TestCase): 5class LayerSourceVerifyInheritanceSaveLoad(TestCase):
6 def test_object_creation(self): 6 def test_object_creation(self):
7 lls = LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "") 7 lls = LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "")
8 lils = LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LAYERINDEX, apiurl = "") 8 lils = LayerSource.objects.create(name = "a2", sourcetype = LayerSource.TYPE_LAYERINDEX, apiurl = "")
9 imls = LayerSource.objects.create(name = "a3", sourcetype = LayerSource.TYPE_IMPORTED, apiurl = "")
9 10
10 print LayerSource.objects.all() 11 import pprint
12 pprint.pprint([(x.__class__,vars(x)) for x in LayerSource.objects.all()])
11 13
12 self.assertTrue(True in map(lambda x: isinstance(x, LocalLayerSource), LayerSource.objects.all())) 14 self.assertTrue(True in map(lambda x: isinstance(x, LocalLayerSource), LayerSource.objects.all()))
13 self.assertTrue(True in map(lambda x: isinstance(x, LayerIndexLayerSource), LayerSource.objects.all())) 15 self.assertTrue(True in map(lambda x: isinstance(x, LayerIndexLayerSource), LayerSource.objects.all()))
16 self.assertTrue(True in map(lambda x: isinstance(x, ImportedLayerSource), LayerSource.objects.all()))
14 17
15 def test_duplicate_error(self): 18 def test_duplicate_error(self):
16 def duplicate(): 19 def duplicate():
@@ -18,7 +21,7 @@ class LayerSourceVerifyInheritanceSaveLoad(TestCase):
18 LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "") 21 LayerSource.objects.create(name = "a1", sourcetype = LayerSource.TYPE_LOCAL, apiurl = "")
19 22
20 self.assertRaises(Exception, duplicate) 23 self.assertRaises(Exception, duplicate)
21 24
22 25
23 26
24class LILSUpdateTestCase(TestCase): 27class LILSUpdateTestCase(TestCase):