diff options
Diffstat (limited to 'bitbake/lib/bb/tests/utils.py')
-rw-r--r-- | bitbake/lib/bb/tests/utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/utils.py b/bitbake/lib/bb/tests/utils.py index a7ff33db52..4d5e21b99e 100644 --- a/bitbake/lib/bb/tests/utils.py +++ b/bitbake/lib/bb/tests/utils.py | |||
@@ -666,3 +666,21 @@ class GetReferencedVars(unittest.TestCase): | |||
666 | 666 | ||
667 | layers = [{"SRC_URI"}, {"QT_GIT", "QT_MODULE", "QT_MODULE_BRANCH_PARAM", "QT_GIT_PROTOCOL"}, {"QT_GIT_PROJECT", "QT_MODULE_BRANCH", "BPN"}, {"PN", "SPECIAL_PKGSUFFIX"}] | 667 | layers = [{"SRC_URI"}, {"QT_GIT", "QT_MODULE", "QT_MODULE_BRANCH_PARAM", "QT_GIT_PROTOCOL"}, {"QT_GIT_PROJECT", "QT_MODULE_BRANCH", "BPN"}, {"PN", "SPECIAL_PKGSUFFIX"}] |
668 | self.check_referenced("${SRC_URI}", layers) | 668 | self.check_referenced("${SRC_URI}", layers) |
669 | |||
670 | |||
671 | class EnvironmentTests(unittest.TestCase): | ||
672 | def test_environment(self): | ||
673 | os.environ["A"] = "this is A" | ||
674 | self.assertIn("A", os.environ) | ||
675 | self.assertEqual(os.environ["A"], "this is A") | ||
676 | self.assertNotIn("B", os.environ) | ||
677 | |||
678 | with bb.utils.environment(B="this is B"): | ||
679 | self.assertIn("A", os.environ) | ||
680 | self.assertEqual(os.environ["A"], "this is A") | ||
681 | self.assertIn("B", os.environ) | ||
682 | self.assertEqual(os.environ["B"], "this is B") | ||
683 | |||
684 | self.assertIn("A", os.environ) | ||
685 | self.assertEqual(os.environ["A"], "this is A") | ||
686 | self.assertNotIn("B", os.environ) | ||