test_lsupdates.py 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #! /usr/bin/env python
  2. #
  3. # BitBake Toaster Implementation
  4. #
  5. # Copyright (C) 2016 Intel Corporation
  6. #
  7. # SPDX-License-Identifier: GPL-2.0-only
  8. #
  9. from django.test import TestCase
  10. from django.core import management
  11. from orm.models import Layer_Version, Machine, Recipe
  12. class TestLayerIndexUpdater(TestCase):
  13. def test_run_lsupdates_command(self):
  14. # Load some release information for us to fetch from the layer index
  15. management.call_command('loaddata', 'poky')
  16. old_layers_count = Layer_Version.objects.count()
  17. old_recipes_count = Recipe.objects.count()
  18. old_machines_count = Machine.objects.count()
  19. # Now fetch the metadata from the layer index
  20. management.call_command('lsupdates')
  21. self.assertTrue(Layer_Version.objects.count() > old_layers_count,
  22. "lsupdates ran but we still have no more layers!")
  23. self.assertTrue(Recipe.objects.count() > old_recipes_count,
  24. "lsupdates ran but we still have no more Recipes!")
  25. self.assertTrue(Machine.objects.count() > old_machines_count,
  26. "lsupdates ran but we still have no more Machines!")