Skip to content

Commit

Permalink
Refactor test urls file
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed May 8, 2024
1 parent 8dad79b commit f8d0806
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
from django.urls import include, path

from rest_framework import routers

from resolwe.api_urls import api_router as resolwe_router
from resolwe.flow.views import EntityViewSet

from resolwe_bio.filters import BioEntityFilter
from resolwe_bio.kb.views import (
FeatureViewSet, MappingSearchViewSet
)
from resolwe_bio.kb.views import FeatureViewSet, MappingSearchViewSet
from resolwe_bio.variants.views import VariantAnnotationViewSet, VariantViewSet

from .routers import SearchRouter


EntityViewSet.filterset_class = BioEntityFilter

api_router = routers.DefaultRouter(trailing_slash=False)
api_router.register(r'sample', EntityViewSet)
api_router.register(r"sample", EntityViewSet)
api_router.register(r"variant", VariantViewSet)
api_router.register(r"variant_annotations", VariantAnnotationViewSet)

search_router = SearchRouter(trailing_slash=False)
search_router.register(r'kb/feature', FeatureViewSet, 'kb_feature')
search_router.register(r'kb/mapping/search', MappingSearchViewSet, 'kb_mapping_search')
search_router.register(r"kb/feature", FeatureViewSet, "kb_feature")
search_router.register(r"kb/mapping/search", MappingSearchViewSet, "kb_mapping_search")

urlpatterns = [
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
# XXX: Temporary fix to work with Resolwe 2.0.0, which requires 'resolwe-api' namespace to be available when
# reporting errors when running processes.
path('api-resolwe/', include((resolwe_router.urls, 'resolwe-api'))),
path('api/', include((api_router.urls + search_router.urls + resolwe_router.urls, 'resolwebio-api'))),
path("api-resolwe/", include((resolwe_router.urls, "resolwe-api"))),
path(
"api/",
include(
(
api_router.urls + search_router.urls + resolwe_router.urls,
"resolwebio-api",
)
),
),
]

0 comments on commit f8d0806

Please sign in to comment.