Skip to content

Commit 9a98ed0

Browse files
committed
fixing test cov
1 parent c6462a4 commit 9a98ed0

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

ellar_django/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def django_command_wrapper() -> None:
2323
args = []
2424
skip = 1
2525

26-
if "manage.py" in sys.argv:
26+
if "manage.py" in sys.argv: # pragma: no cover
2727
skip = 2
2828

2929
for item in sys.argv[skip:]:

ellar_django/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, app: ASGIApp, path_prefix: str) -> None:
1010
self.path_prefix = path_prefix
1111

1212
async def __call__(self, scope: TScope, receive: TReceive, send: TSend) -> t.Any:
13-
if scope["type"] != "http":
13+
if scope["type"] != "http": # pragma: no cover
1414
return await self.app(scope, receive, send)
1515

1616
async def sender(message: TMessage) -> None:

ellar_django/module.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ async def _redirect_route(req: Request) -> RedirectResponse:
2222
class DjangoModule(IModuleSetup):
2323
@classmethod
2424
def setup(cls, settings_module: str, path_prefix: str = "/dj") -> "DynamicModule":
25+
assert path_prefix not in [
26+
"",
27+
"/",
28+
], "Invalid path prefix, please set a valid path prefix"
29+
2530
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
2631
_router_as_mount = ModuleRouterBuilder.build(_router)
2732

0 commit comments

Comments
 (0)