kiwi-el8/test/unit/defaults_test.py
Marcus Schäfer e6cc5bfa09 Move from nose to pytest
nose is no longer maintained, thus we have to move to another
testing system. This commit updates the tox setup and all tests
to use pytest instead of nose.
2016-03-14 12:23:14 +01:00

39 lines
1.2 KiB
Python

from mock import patch
import mock
from .test_helper import *
from kiwi.defaults import Defaults
class TestDefaults(object):
def setup(self):
self.defaults = Defaults()
def test_get(self):
assert self.defaults.get('kiwi_align') == 1048576
assert self.defaults.get('kiwi_startsector') == 2048
assert self.defaults.get('kiwi_sectorsize') == 512
assert self.defaults.get('kiwi_inode_size') == 256
assert self.defaults.get('kiwi_inode_ratio') == 16384
assert self.defaults.get('kiwi_min_inodes') == 20000
assert self.defaults.get('kiwi_revision')
def test_to_profile(self):
profile = mock.MagicMock()
self.defaults.to_profile(profile)
profile.add.assert_any_call('kiwi_align', 1048576)
profile.add.assert_any_call('kiwi_startsector', 2048)
profile.add.assert_any_call('kiwi_sectorsize', 512)
profile.add.assert_any_call(
'kiwi_revision', self.defaults.get('kiwi_revision')
)
def test_get_preparer(self):
assert Defaults.get_preparer() == 'KIWI - http://suse.github.com/kiwi'
def test_get_publisher(self):
assert Defaults.get_publisher() == 'SUSE LINUX GmbH'