mirror of
https://github.com/ceph/ceph
synced 2024-12-17 00:46:05 +00:00
ceph-volume: tests: update coverage comments
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
21c8854e61
commit
4c7300ce25
@ -1,8 +1,8 @@
|
||||
import os
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
except ImportError: # pragma: no cover
|
||||
from io import StringIO # pragma: no cover
|
||||
from textwrap import dedent
|
||||
import pytest
|
||||
from ceph_volume import configuration, exceptions
|
||||
|
@ -9,11 +9,11 @@ class TestNeedsRoot(object):
|
||||
def func():
|
||||
return True
|
||||
monkeypatch.setattr(decorators.os, 'getuid', lambda: 0)
|
||||
assert decorators.needs_root(func)()() is True
|
||||
assert decorators.needs_root(func)() is True
|
||||
|
||||
def test_is_not_root(self, monkeypatch):
|
||||
def func():
|
||||
return True
|
||||
return True # pragma: no cover
|
||||
monkeypatch.setattr(decorators.os, 'getuid', lambda: 20)
|
||||
with pytest.raises(exceptions.SuperUserError) as error:
|
||||
decorators.needs_root(func)()
|
||||
|
Loading…
Reference in New Issue
Block a user