From cb72774a7ae0eb9d513438b752e525b3900da14c Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Sun, 19 Sep 2021 23:54:43 +0200 Subject: [PATCH] Fix test import issue --- database/__init__.py | 2 +- database/db.py | 3 --- database/models.py | 5 ++++- tests/data/__init__.py => requirements-dev.txt | 0 tests/{data/embeds => test_data}/__init__.py | 0 tests/{functions => test_data/test_embeds}/__init__.py | 0 .../test_embeds}/test_urban_dictionary.py | 0 tests/{data => test_data}/test_regexes.py | 0 tests/{data => test_data}/test_schedule.py | 0 tests/{data => test_data}/test_snipe.py | 0 tests/{functions/scrapers => test_functions}/__init__.py | 0 tests/test_functions/test_scrapers/__init__.py | 0 .../scrapers => test_functions/test_scrapers}/test_sporza.py | 0 tests/{functions => test_functions}/test_timeFormatters.py | 0 14 files changed, 5 insertions(+), 5 deletions(-) rename tests/data/__init__.py => requirements-dev.txt (100%) rename tests/{data/embeds => test_data}/__init__.py (100%) rename tests/{functions => test_data/test_embeds}/__init__.py (100%) rename tests/{data/embeds => test_data/test_embeds}/test_urban_dictionary.py (100%) rename tests/{data => test_data}/test_regexes.py (100%) rename tests/{data => test_data}/test_schedule.py (100%) rename tests/{data => test_data}/test_snipe.py (100%) rename tests/{functions/scrapers => test_functions}/__init__.py (100%) create mode 100644 tests/test_functions/test_scrapers/__init__.py rename tests/{functions/scrapers => test_functions/test_scrapers}/test_sporza.py (100%) rename tests/{functions => test_functions}/test_timeFormatters.py (100%) diff --git a/database/__init__.py b/database/__init__.py index 45576aa..7a2db53 100644 --- a/database/__init__.py +++ b/database/__init__.py @@ -1,2 +1,2 @@ -from .db import engine, session, Base +from .db import engine, session from .models import * diff --git a/database/db.py b/database/db.py index 238e6a3..568e5f6 100644 --- a/database/db.py +++ b/database/db.py @@ -1,6 +1,5 @@ from settings import DB_HOST, DB_NAME, DB_PASSWORD, DB_USERNAME, DB_DIALECT, DB_DRIVER from sqlalchemy import create_engine -from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import Session, sessionmaker from urllib.parse import quote_plus @@ -12,5 +11,3 @@ engine = create_engine( f"{DB_DIALECT}{'+' if DB_DRIVER else ''}{DB_DRIVER}://{DB_USERNAME}:{_encoded_pw}@{DB_HOST}/{DB_NAME}" ) session: Session = sessionmaker(bind=engine)() - -Base = declarative_base() diff --git a/database/models.py b/database/models.py index 2338460..8ab9420 100644 --- a/database/models.py +++ b/database/models.py @@ -1,8 +1,11 @@ -from database import Base +from sqlalchemy.orm import declarative_base from sqlalchemy import Column, String, Integer, BigInteger, Numeric, Date, Boolean from typing import Set +Base = declarative_base() + + # TODO fill in non-nulls everywhere # TODO comments diff --git a/tests/data/__init__.py b/requirements-dev.txt similarity index 100% rename from tests/data/__init__.py rename to requirements-dev.txt diff --git a/tests/data/embeds/__init__.py b/tests/test_data/__init__.py similarity index 100% rename from tests/data/embeds/__init__.py rename to tests/test_data/__init__.py diff --git a/tests/functions/__init__.py b/tests/test_data/test_embeds/__init__.py similarity index 100% rename from tests/functions/__init__.py rename to tests/test_data/test_embeds/__init__.py diff --git a/tests/data/embeds/test_urban_dictionary.py b/tests/test_data/test_embeds/test_urban_dictionary.py similarity index 100% rename from tests/data/embeds/test_urban_dictionary.py rename to tests/test_data/test_embeds/test_urban_dictionary.py diff --git a/tests/data/test_regexes.py b/tests/test_data/test_regexes.py similarity index 100% rename from tests/data/test_regexes.py rename to tests/test_data/test_regexes.py diff --git a/tests/data/test_schedule.py b/tests/test_data/test_schedule.py similarity index 100% rename from tests/data/test_schedule.py rename to tests/test_data/test_schedule.py diff --git a/tests/data/test_snipe.py b/tests/test_data/test_snipe.py similarity index 100% rename from tests/data/test_snipe.py rename to tests/test_data/test_snipe.py diff --git a/tests/functions/scrapers/__init__.py b/tests/test_functions/__init__.py similarity index 100% rename from tests/functions/scrapers/__init__.py rename to tests/test_functions/__init__.py diff --git a/tests/test_functions/test_scrapers/__init__.py b/tests/test_functions/test_scrapers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/functions/scrapers/test_sporza.py b/tests/test_functions/test_scrapers/test_sporza.py similarity index 100% rename from tests/functions/scrapers/test_sporza.py rename to tests/test_functions/test_scrapers/test_sporza.py diff --git a/tests/functions/test_timeFormatters.py b/tests/test_functions/test_timeFormatters.py similarity index 100% rename from tests/functions/test_timeFormatters.py rename to tests/test_functions/test_timeFormatters.py