Skip to content

Commit ad096ca

Browse files
arthur-mesquitadan5e3s6ares
authored andcommitted
Fix imports
1 parent 0e0268e commit ad096ca

File tree

9 files changed

+21
-10
lines changed

9 files changed

+21
-10
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
API_CONTAINER_NAME=pynews-server
12
.PHONY: help build up down logs test lint format clean dev prod restart health
23

34
# Colors for terminal output
@@ -73,3 +74,7 @@ shell: ## Entra no shell do container
7374
setup: install build up ## Setup completo do projeto
7475
@echo "$(GREEN)Setup completo realizado!$(NC)"
7576
@echo "$(GREEN)Acesse: http://localhost:8000/docs$(NC)"
77+
78+
79+
docker/test:
80+
docker exec -e PYTHONPATH=/app $(API_CONTAINER_NAME) pytest -s --cov-report=term-missing --cov-report html --cov-report=xml --cov=app tests/

app/routers/news/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from fastapi import APIRouter, Depends, Request, status
44
from fastapi.params import Header
55
from pydantic import BaseModel
6-
from routers.authentication import get_current_active_community
7-
from services.database.orm.news import create_news, get_news_by_query_params
86

7+
from app.routers.authentication import get_current_active_community
98
from app.schemas import News
109
from app.services.database.models import Community as DBCommunity
10+
from app.services.database.orm.news import create_news, get_news_by_query_params
1111

1212

1313
class NewsPostResponse(BaseModel):

app/services/database/models/subscriptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from typing import List, Optional
22

3-
from schemas import SubscriptionTagEnum
43
from sqlalchemy import JSON, Column
54
from sqlmodel import Field, SQLModel
65

6+
from app.schemas import SubscriptionTagEnum
7+
78

89
class Subscription(SQLModel, table=True):
910
__tablename__ = "subscriptions" # type: ignore

app/services/database/orm/news.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from typing import Optional
22

3-
from services.database.models import News
43
from sqlmodel import select
54
from sqlmodel.ext.asyncio.session import AsyncSession
65

6+
from app.services.database.models import News
7+
78

89
async def create_news(session: AsyncSession, news: dict) -> None:
910
_news = News(

tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import pytest
22
from fastapi import status
33
from httpx import AsyncClient
4-
from services.database.models import Community
54

5+
from app.services.database.models import Community
66
from tests.conftest import CommunityCredentials
77

88

tests/test_communities.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import pytest
2-
from services.database.models import Community
32
from sqlmodel import select
43
from sqlmodel.ext.asyncio.session import AsyncSession
54

5+
from app.services.database.models import Community
6+
67

78
@pytest.mark.asyncio
89
async def test_insert_communities(session: AsyncSession):

tests/test_libraries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import pytest
22
import pytest_asyncio
33
from httpx import AsyncClient
4-
from services.database.models import Community, Library
54
from sqlmodel import select
65
from sqlmodel.ext.asyncio.session import AsyncSession
76

7+
from app.services.database.models import Community, Library
8+
89

910
@pytest_asyncio.fixture
1011
async def community(session: AsyncSession):

tests/test_news.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
import pytest_asyncio
66
from fastapi import status
77
from httpx import AsyncClient
8-
from services.database.models import Community, News
98
from sqlmodel import select
109
from sqlmodel.ext.asyncio.session import AsyncSession
1110

11+
from app.services.database.models import Community, News
12+
1213

1314
@pytest_asyncio.fixture
1415
async def news_list(community: Community) -> list[News]:

tests/test_subscriptions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import pytest
22
import pytest_asyncio
33
from httpx import AsyncClient
4-
from schemas import SubscriptionTagEnum
5-
from services.database.models import Community, Subscription
64
from sqlmodel import select
75
from sqlmodel.ext.asyncio.session import AsyncSession
86

7+
from app.schemas import SubscriptionTagEnum
8+
from app.services.database.models import Community, Subscription
9+
910

1011
@pytest_asyncio.fixture
1112
async def community(session: AsyncSession):

0 commit comments

Comments
 (0)