kiwi-el8/test/unit/utils/toenv_test.py
Marcus Schäfer 5c217afa00
Add support for reading optional pkgmgr env file
If there is a file .kiwi.package_manager.env in the root of
the image tree it will be read and put into the caller environment for
the selected package and repository manager. There are features
in e.g zypper which can only be used via env variables.
This Fixes bsc#1235448
2025-01-13 15:53:54 +01:00

19 lines
437 B
Python

from pytest import raises
import os
from kiwi.utils.toenv import ToEnv
from kiwi.exceptions import KiwiEnvImportError
class TestToEnv(object):
def setup(self):
ToEnv('../data', 'some.env')
assert os.environ['ZYPP_MODALIAS_SYSFS'] == ''
def setup_method(self, cls):
self.setup()
def test_setup_raises(self):
with raises(KiwiEnvImportError):
ToEnv('../data', 'some_broken.env')