blob: 3c4fbe0550b776207e3082eec94656a81d522b67 [file] [log] [blame]
Brad Bishop96ff1982019-08-19 13:50:42 -04001#! /usr/bin/env python3
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002#
3# BitBake Toaster Implementation
4#
5# Copyright (C) 2016 Intel Corporation
6#
Brad Bishopc342db32019-05-15 21:57:59 -04007# SPDX-License-Identifier: GPL-2.0-only
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008#
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009
10from django.test import TestCase
11from django.core import management
12
13from orm.models import Layer_Version, Machine, Recipe
14
15
16class TestLayerIndexUpdater(TestCase):
17 def test_run_lsupdates_command(self):
18 # Load some release information for us to fetch from the layer index
19 management.call_command('loaddata', 'poky')
20
21 old_layers_count = Layer_Version.objects.count()
22 old_recipes_count = Recipe.objects.count()
23 old_machines_count = Machine.objects.count()
24
25 # Now fetch the metadata from the layer index
26 management.call_command('lsupdates')
27
28 self.assertTrue(Layer_Version.objects.count() > old_layers_count,
29 "lsupdates ran but we still have no more layers!")
30 self.assertTrue(Recipe.objects.count() > old_recipes_count,
31 "lsupdates ran but we still have no more Recipes!")
32 self.assertTrue(Machine.objects.count() > old_machines_count,
33 "lsupdates ran but we still have no more Machines!")