ceph-volume: tests: update coverage comments

Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
Alfredo Deza 2017-07-17 15:44:23 -04:00
parent 21c8854e61
commit 4c7300ce25
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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)()