From 6cad0d8162fc15140f5d628c84d60f0282506609 Mon Sep 17 00:00:00 2001 From: mateuvrs Date: Tue, 7 Nov 2023 00:09:41 -0300 Subject: [PATCH 01/10] =?UTF-8?q?style(utils):=20muda=20localiza=C3=A7?= =?UTF-8?q?=C3=A3o=20dos=20arquivos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: HenrikhKenino <110349110+HenrikhKenino@users.noreply.github.com> --- api/{api => }/utils/db_handler.py | 0 api/{api => }/utils/sessions.py | 0 api/{api => }/utils/web_scraping.py | 3 +-- 3 files changed, 1 insertion(+), 2 deletions(-) rename api/{api => }/utils/db_handler.py (100%) rename api/{api => }/utils/sessions.py (100%) rename api/{api => }/utils/web_scraping.py (97%) diff --git a/api/api/utils/db_handler.py b/api/utils/db_handler.py similarity index 100% rename from api/api/utils/db_handler.py rename to api/utils/db_handler.py diff --git a/api/api/utils/sessions.py b/api/utils/sessions.py similarity index 100% rename from api/api/utils/sessions.py rename to api/utils/sessions.py diff --git a/api/api/utils/web_scraping.py b/api/utils/web_scraping.py similarity index 97% rename from api/api/utils/web_scraping.py rename to api/utils/web_scraping.py index f67218b2..dd2dcae5 100644 --- a/api/api/utils/web_scraping.py +++ b/api/utils/web_scraping.py @@ -22,9 +22,8 @@ disciplines.get_disciplines() # Retorna um dicionário com as disciplinas ''' -def get_list_of_departments() -> Optional[List]: +def get_list_of_departments(response = get_response(create_request_session())) -> Optional[List]: """Obtem a lista de departamentos da UnB.""" - response = get_response(create_request_session()) # Get the response from the request session soup = BeautifulSoup(response.content, "html.parser") # Create a BeautifulSoup object departments = soup.find("select", attrs={"id": "formTurma:inputDepto"}) # Find the + + + + + + + + + + + + + + + + + + + + + + + +
Informe os critérios de busca das turmas
Nível de Ensino: + +
Unidade: + +
Ano - Período: + - + +
+   + +
+ +
+ + + + + + + +
+
+ Campos de preenchimento obrigatório. +
+
+
+ << Voltar ao menu principal +
+
+ + +
+ + +
+

+ SIGAA | Secretaria de Tecnologia da Informação - STI - (61) 3107-0102 | Copyright © 2006-2023 - UFRN - app46_Prod.sigaa40 + + v4.9.10.38 + +

+
+ + + + + + + + + + + + + + + + + + + + + + + From 0dbc6533643615214ab66a0f77b06e27116a1fcd Mon Sep 17 00:00:00 2001 From: MateusVrs Date: Tue, 7 Nov 2023 10:46:05 -0300 Subject: [PATCH 10/10] =?UTF-8?q?api(urls):=20refatora=20a=20adi=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20rota=20p/tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/core/urls.py | 7 ++++++- api/utils/urls.py | 10 +++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/api/core/urls.py b/api/core/urls.py index 74ae062b..671b882b 100644 --- a/api/core/urls.py +++ b/api/core/urls.py @@ -16,9 +16,14 @@ """ from django.contrib import admin from django.urls import path, include +import sys urlpatterns = [ path('admin/', admin.site.urls), path('users/', include('users.urls')), - path('mock/', include('utils.urls')), ] + +if 'test' in sys.argv: + urlpatterns += [ + path('utils/', include('utils.urls')) + ] diff --git a/api/utils/urls.py b/api/utils/urls.py index 739af5f4..9b39a557 100644 --- a/api/utils/urls.py +++ b/api/utils/urls.py @@ -1,12 +1,8 @@ from django.urls import path from .views import mocked_departments -import sys app_name = 'utils' -urlpatterns = [] - -if 'test' in sys.argv: - urlpatterns += [ - path('departments/', mocked_departments, name='departments'), - ] +urlpatterns = [ + path('mock/departments/', mocked_departments, name='departments'), +]