Skip to content

Commit

Permalink
starting up db testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
milsman2 committed Jan 29, 2024
1 parent 45d55b4 commit b17bf19
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
Empty file added scraper/db/testDB.db
Empty file.
11 changes: 11 additions & 0 deletions scraper/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
"""

from icecream import ic
from src.schemas import TournamentSchema


def run():
ic()
tourney = TournamentSchema(
id=1,
name="test",
slug=1234,
city="test",
state="test",
phone=1234,
email="test",
)
ic(tourney)


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions scraper/src/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .tournament import TournamentSchema, TourneyRoundSchema
23 changes: 23 additions & 0 deletions scraper/src/schemas/tournament.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Tournament schema
"""
from pydantic import BaseModel, Field
from typing import Optional


class TournamentSchema(BaseModel):
tournament_id: int = Field(..., alias="id")
name: str
slug: int
city: str
state: str
phone: int
email: Optional[str] = None


class TourneyRoundSchema(BaseModel):
player_id: int
score: int
tournament: TournamentSchema
rating: int
round: int
Empty file added scraper/tests/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions scraper/tests/test_schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
Testing settings.
"""


def f():
return 3


def test_function():
assert f() == 4

0 comments on commit b17bf19

Please sign in to comment.