poky/bitbake/lib/toaster/tests/commands/test_loaddata.py
Richard Purdie 9501864db8 bitbake: bitbake: Strip old editor directives from file headers
There are much better ways to handle this and most editors shouldn't need this
in modern times, drop the noise from the files. Its not consitently applied
anyway.

(Bitbake rev: 5e43070e3087d09aea2f459b033d035c5ef747d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:10 +01:00

50 lines
1.6 KiB
Python

#! /usr/bin/env python
#
# BitBake Toaster Implementation
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
from django.test import TestCase
from django.core import management
from orm.models import Layer_Version, Layer, Release, ToasterSetting
class TestLoadDataFixtures(TestCase):
""" Test loading our 3 provided fixtures """
def test_run_loaddata_poky_command(self):
management.call_command('loaddata', 'poky')
num_releases = Release.objects.count()
self.assertTrue(
Layer_Version.objects.filter(
layer__name="meta-poky").count() == num_releases,
"Loaded poky fixture but don't have a meta-poky for all releases"
" defined")
def test_run_loaddata_oecore_command(self):
management.call_command('loaddata', 'oe-core')
# We only have the one layer for oe-core setup
self.assertTrue(
Layer.objects.filter(name="openembedded-core").count() > 0,
"Loaded oe-core fixture but still have no openemebedded-core"
" layer")
def test_run_loaddata_settings_command(self):
management.call_command('loaddata', 'settings')
self.assertTrue(
ToasterSetting.objects.filter(name="DEFAULT_RELEASE").count() > 0,
"Loaded settings but have no DEFAULT_RELEASE")
self.assertTrue(
ToasterSetting.objects.filter(
name__startswith="DEFCONF").count() > 0,
"Loaded settings but have no DEFCONF (default project "
"configuration values)")