mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00

For example if PACKAGES is "foo foo-data foo-dev foo-doc", this will return "foo-data". (From OE-Core rev: 3115187e468398a8c1edaf3e5369a2d10fb112f4) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
28 lines
880 B
Python
28 lines
880 B
Python
import unittest
|
|
import bb, oe.utils
|
|
|
|
class TestPackagesFilterOutSystem(unittest.TestCase):
|
|
def test_filter(self):
|
|
"""
|
|
Test that oe.utils.packages_filter_out_system works.
|
|
"""
|
|
|
|
d = bb.data_smart.DataSmart()
|
|
d.setVar("PN", "foo")
|
|
|
|
d.setVar("PACKAGES", "foo foo-doc foo-dev")
|
|
pkgs = oe.utils.packages_filter_out_system(d)
|
|
self.assertEqual(pkgs, [])
|
|
|
|
d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
|
|
pkgs = oe.utils.packages_filter_out_system(d)
|
|
self.assertEqual(pkgs, ["foo-data"])
|
|
|
|
d.setVar("PACKAGES", "foo foo-locale-en-gb")
|
|
pkgs = oe.utils.packages_filter_out_system(d)
|
|
self.assertEqual(pkgs, [])
|
|
|
|
d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
|
|
pkgs = oe.utils.packages_filter_out_system(d)
|
|
self.assertEqual(pkgs, ["foo-data"])
|