Skip to content

Commit

Permalink
add pragma no cover and abstractmethod decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Jun 21, 2024
1 parent dd66cb8 commit e04cce5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/custom_auth/oauth/serializers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from abc import abstractmethod

from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.signals import user_logged_in
Expand Down Expand Up @@ -107,11 +109,12 @@ def _get_user(self, user_data: dict):

return existing_user

@abstractmethod
def get_user_info(self):
raise NotImplementedError("`get_user_info()` must be implemented.")

def get_auth_type(self) -> AuthType:
if not self.auth_type:
if not self.auth_type: # pragma: no cover
raise NotImplementedError(
"`auth_type` must be set, or `get_auth_type()` must be implemented."
)
Expand Down

0 comments on commit e04cce5

Please sign in to comment.