Mark abstractmethod bodies with nocover

abstractmethod bodies aren't going to be called by unit tests, so
there's no way to get coverage. The code in an abstractmethod body
should be marked with "# pragma: no cover" so that they don't show
up as missed in the coverage report.

Change-Id: I88a7481ab22f2ce1abfd62badc5f5048acc6929f
This commit is contained in:
Brant Knudson 2015-10-21 13:35:53 -05:00
parent 574fad7abb
commit a8d2bd2934
7 changed files with 12 additions and 11 deletions

View File

@ -184,7 +184,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin):
:returns: Token access information.
:rtype: :py:class:`keystoneclient.access.AccessInfo`
"""
pass
pass # pragma: no cover
def get_token(self, session, **kwargs):
"""Return a valid auth token.

View File

@ -99,7 +99,7 @@ class BaseGenericPlugin(base.BaseIdentityPlugin):
:returns: A plugin that can match the parameters or None if nothing.
"""
return None
return None # pragma: no cover
@property
def _has_domain_scope(self):

View File

@ -103,7 +103,7 @@ class Auth(base.BaseIdentityPlugin):
:return: A dict of authentication data for the auth type.
:rtype: dict
"""
pass
pass # pragma: no cover
_NOT_PASSED = object()

View File

@ -85,7 +85,7 @@ class BaseAuth(base.BaseIdentityPlugin):
@abc.abstractmethod
def get_auth_ref(self, session, **kwargs):
return None
return None # pragma: no cover
@classmethod
def get_options(cls):
@ -240,7 +240,7 @@ class AuthMethod(object):
data for the auth type.
:rtype: tuple(string, dict)
"""
pass
pass # pragma: no cover
@six.add_metaclass(abc.ABCMeta)

View File

@ -116,3 +116,4 @@ class FederatedBaseAuth(base.BaseAuth):
@abc.abstractmethod
def get_unscoped_auth_ref(self, session, **kwargs):
"""Fetch unscoped federated token."""
pass # pragma: no cover

View File

@ -242,7 +242,7 @@ class ManagerWithFind(Manager):
@abc.abstractmethod
def list(self):
pass
pass # pragma: no cover
def find(self, **kwargs):
"""Find a single item with attributes matching ``**kwargs``.

View File

@ -101,7 +101,7 @@ class ServiceCatalog(object):
- `domain_id`: Authorized domain's ID
"""
raise NotImplementedError()
raise NotImplementedError() # pragma: no cover
@abc.abstractmethod
def _is_endpoint_type_match(self, endpoint, endpoint_type):
@ -110,7 +110,7 @@ class ServiceCatalog(object):
:returns: True if the provided endpoint matches the required
endpoint_type otherwise False.
"""
pass
pass # pragma: no cover
@abc.abstractmethod
def _normalize_endpoint_type(self, endpoint_type):
@ -123,7 +123,7 @@ class ServiceCatalog(object):
:returns: the endpoint string in the format appropriate for this
service catalog.
"""
pass
pass # pragma: no cover
def get_endpoints(self, service_type=None, endpoint_type=None,
region_name=None, service_name=None):
@ -229,7 +229,7 @@ class ServiceCatalog(object):
:returns: tuple of urls or None (if no match found)
"""
raise NotImplementedError()
raise NotImplementedError() # pragma: no cover
@utils.positional(3, enforcement=utils.positional.WARN)
def url_for(self, attr=None, filter_value=None,
@ -303,7 +303,7 @@ class ServiceCatalog(object):
:returns: list containing raw catalog data entries or None
"""
raise NotImplementedError()
raise NotImplementedError() # pragma: no cover
class ServiceCatalogV2(ServiceCatalog):