kiwi-el8/test/unit/runtime_config_test.py
Marcus Schäfer dee0a5af7f Refactor handling of obs repositories
* Delete kiwi internal ibs: and suse: types
* Delete handling for --obs-repo-internal and provide a
  compatibility message to the user
* Buildservice download server url and scope can be configured
  via ~/.config/kiwi/config.yml
* Translate obs urls to http in import_repositories_marked_as_imageinclude
* Use new Uri.is_public method in renamed runtime check
  check_image_include_repos_publicly_resolvable
2017-07-05 16:07:29 +02:00

40 lines
1.4 KiB
Python

from mock import patch
from .test_helper import raises
from kiwi.runtime_config import RuntimeConfig
from kiwi.exceptions import KiwiRuntimeConfigFormatError
from kiwi.defaults import Defaults
class TestRuntimeConfig(object):
def setup(self):
with patch.dict('os.environ', {'HOME': '../data'}):
self.runtime_config = RuntimeConfig()
@raises(KiwiRuntimeConfigFormatError)
def test_invalid_yaml_format(self):
self.runtime_config.config_data = {'xz': None}
self.runtime_config.get_xz_options()
def test_get_xz_options(self):
assert self.runtime_config.get_xz_options() == ['-a', '-b', 'xxx']
def test_is_obs_public(self):
assert self.runtime_config.is_obs_public() is True
def test_is_obs_public_default(self):
with patch.dict('os.environ', {'HOME': './'}):
runtime_config = RuntimeConfig()
assert runtime_config.is_obs_public() is True
def test_get_obs_download_server_url(self):
assert self.runtime_config.get_obs_download_server_url() == \
'http://example.com'
def test_get_obs_download_server_url_default(self):
with patch.dict('os.environ', {'HOME': './'}):
runtime_config = RuntimeConfig()
assert runtime_config.get_obs_download_server_url() == \
Defaults.get_obs_download_server_url()