[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1509/8267] bitbake: toaster: tests: Remove references to LayerSource model
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1509/8267] bitbake: toaster: tests: Remove references to LayerSource model
- Date: Sat, 16 Dec 2017 21:55:38 +0000 (UTC)
commit bb260e94a63d6d498c9c76b862bc836a90678495
Author: Michael Wood <michael g wood intel com>
Date: Thu Jul 21 14:43:28 2016 +0100
bitbake: toaster: tests: Remove references to LayerSource model
Remove and replace layersource model references in the tests and test
data. Remove the orm/test as this only tested LayerSource interactions
which have now been removed.
(Bitbake rev: 61a47cbc92c856690cb0e8da7102b2e669eaee0a)
Signed-off-by: Michael Wood <michael g wood intel com>
Signed-off-by: Elliot Smith <elliot smith intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
.../bldcontrol/management/commands/loadconf.py | 18 --
bitbake/lib/toaster/orm/tests.py | 180 --------------------
.../tests/browser/test_layerdetails_page.py | 2 +-
.../fixtures/toastergui-unittest-data.xml | 39 -----
bitbake/lib/toaster/toastergui/tests.py | 3 +-
5 files changed, 2 insertions(+), 240 deletions(-)
---
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
index 6f08f1d..1f57fc1 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py
@@ -9,24 +9,6 @@ from .checksettings import DN
import logging
logger = logging.getLogger("toaster")
-def _reduce_canon_path(path):
- components = []
- for c in path.split("/"):
- if c == "..":
- del components[-1]
- elif c == ".":
- pass
- else:
- components.append(c)
- if len(components) < 2:
- components.append('')
- return "/".join(components)
-
-def _get_id_for_sourcetype(s):
- for i in LayerSource.SOURCE_TYPE:
- if s == i[1]:
- return i[0]
- raise Exception("Could not find definition for sourcetype '%s'. Valid source types are %s" % (str(s), ',
'.join(map(lambda x: "'%s'" % x[1], LayerSource.SOURCE_TYPE ))))
class Command(BaseCommand):
help = "Loads a toasterconf.json file in the database"
diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
index 71c5c12..0005192 100644
--- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -63,7 +63,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
self.imported_layer_version = Layer_Version.objects.create(
layer=imported_layer,
- layer_source=layer_source,
+ layer_source=LayerSource.TYPE_IMPORTED,
branch=gitrev,
commit=gitrev,
dirpath=subdir,
diff --git a/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
b/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
index 213bf0f..80c1e19 100644
--- a/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
+++ b/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
@@ -195,8 +195,6 @@
<field to="orm.customimagerecipe" name="recipe_appends" rel="ManyToManyRel"><object
pk="3"></object></field>
</object>
<object pk="1" model="orm.recipe">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z recipe</field>
<field type="CharField" name="version">5.2</field>
@@ -212,8 +210,6 @@
<field type="BooleanField" name="is_image">False</field>
</object>
<object pk="2" model="orm.recipe">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a recipe</field>
<field type="CharField" name="version">1.2</field>
@@ -229,8 +225,6 @@
<field type="BooleanField" name="is_image">False</field>
</object>
<object pk="3" model="orm.recipe">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a custom recipe</field>
<field type="CharField" name="version"></field>
@@ -246,8 +240,6 @@
<field type="BooleanField" name="is_image">False</field>
</object>
<object pk="4" model="orm.recipe">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a image recipe</field>
<field type="CharField" name="version">1.2</field>
@@ -263,8 +255,6 @@
<field type="BooleanField" name="is_image">True</field>
</object>
<object pk="5" model="orm.recipe">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z image recipe</field>
<field type="CharField" name="version">1.3</field>
@@ -280,8 +270,6 @@
<field type="BooleanField" name="is_image">True</field>
</object>
<object pk="6" model="orm.recipe">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z custom recipe</field>
<field type="CharField" name="version"></field>
@@ -307,34 +295,23 @@
</object>
<object pk="1" model="orm.machine">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
<field type="CharField" name="name">a machine</field>
<field type="CharField" name="description">a machine</field>
</object>
<object pk="2" model="orm.machine">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
<field type="CharField" name="name">z machine</field>
<field type="CharField" name="description">z machine</field>
</object>
<object pk="3" model="orm.machine">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
<field type="CharField" name="name">g machine</field>
<field type="CharField" name="description">g machine</field>
</object>
- <object pk="1" model="orm.layersource">
- <field type="CharField" name="name">local</field>
- <field type="IntegerField" name="sourcetype">1</field>
- <field type="CharField" name="apiurl"></field>
- </object>
<object pk="1" model="orm.bitbakeversion">
<field type="CharField" name="name">test bbv</field>
<field type="CharField" name="giturl">/tmp/</field>
@@ -355,26 +332,16 @@
<field type="CharField" name="branch_name">master</field>
<field type="TextField" name="helptext"><None></None></field>
</object>
- <object pk="1" model="orm.releaselayersourcepriority">
- <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="priority">0</field>
- </object>
<object pk="1" model="orm.branch">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="CharField" name="name">master</field>
<field type="CharField" name="short_description"></field>
</object>
<object pk="1" model="orm.layer">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a layer</field>
<field type="CharField" name="vcs_url">/tmp/</field>
</object>
<object pk="2" model="orm.layer">
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z layer</field>
<field type="CharField" name="layer_index_url"></field>
@@ -383,8 +350,6 @@
<object pk="1" model="orm.layer_version">
<field to="orm.build" name="build" rel="ManyToOneRel">1</field>
<field to="orm.layer" name="layer" rel="ManyToOneRel">1</field>
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
<field type="CharField" name="branch">master</field>
@@ -397,8 +362,6 @@
<object pk="2" model="orm.layer_version">
<field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
<field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
<field type="CharField" name="branch">testing-branch</field>
@@ -411,8 +374,6 @@
<object pk="3" model="orm.layer_version">
<field to="orm.build" name="build" rel="ManyToOneRel">1</field>
<field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
- <field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
- <field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
<field type="CharField" name="branch">testing-branch</field>
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py
index da530a1..03b73a9 100644
--- a/bitbake/lib/toaster/toastergui/tests.py
+++ b/bitbake/lib/toaster/toastergui/tests.py
@@ -28,7 +28,7 @@ from django.utils import timezone
from django.db.models import Q
from orm.models import Project, Release, BitbakeVersion, Package, LogMessage
-from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build
+from orm.models import LayerSource, Layer, Build
from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
from orm.models import CustomImageRecipe, ProjectVariable
from orm.models import Branch, CustomImagePackage
@@ -149,7 +149,6 @@ class ViewTests(TestCase):
def test_xhr_import_layer(self):
"""Test xhr_importlayer API"""
- LayerSource.objects.create(sourcetype=LayerSource.TYPE_IMPORTED)
#Test for importing an already existing layer
args = {'vcs_url' : "git://git.example.com/test",
'name' : "base-layer",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]