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.
23 lines
559 B
Python
23 lines
559 B
Python
|
|
from mock import patch
|
|
|
|
import mock
|
|
|
|
from .test_helper import *
|
|
|
|
from kiwi.exceptions import *
|
|
from kiwi.privileges import Privileges
|
|
|
|
|
|
class TestPrivileges(object):
|
|
@raises(KiwiPrivilegesError)
|
|
@patch('os.geteuid')
|
|
def test_check_for_root_permiossion_false(self, mock_euid):
|
|
mock_euid.return_value = 1
|
|
Privileges.check_for_root_permissions()
|
|
|
|
@patch('os.geteuid')
|
|
def test_check_for_root_permiossion_true(self, mock_euid):
|
|
mock_euid.return_value = 0
|
|
assert Privileges.check_for_root_permissions() is True
|