Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
imported tests from apply
Browse files Browse the repository at this point in the history
  • Loading branch information
srh-sloan committed Nov 12, 2024
1 parent 1eb62cd commit 76792cb
Show file tree
Hide file tree
Showing 41 changed files with 9,665 additions and 717 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"editor.formatOnSave": false,
"python.testing.pytestArgs": [
"tests_apply",
"tests"
],
"python.testing.unittestEnabled": false,
Expand Down
8 changes: 8 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import connexion
from config import Config
from connexion import FlaskApp
from connexion.resolver import MethodResolver
from connexion.resolver import MethodViewResolver
from fsd_utils import init_sentry
from fsd_utils.healthchecks.checkers import DbChecker
Expand All @@ -20,6 +21,13 @@ def create_app() -> FlaskApp:
get_bundled_specs("/openapi/api.yml"),
validate_responses=True,
resolver=MethodViewResolver("api"),
base_path="/assess",
)
connexion_app.add_api(
get_bundled_specs("/openapi/apply_api.yml"),
validate_responses=True,
resolver=MethodResolver("api"),
base_path="/apply",
)

flask_app = connexion_app.app
Expand Down
11 changes: 0 additions & 11 deletions apply/api/routes/application/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,6 @@ def get_applications_statuses_report(
fund_id: Optional[list] = [],
format: Optional[str] = "csv",
):
print("hello")
current_app.logger.warning("hello")
return jsonify(
{
"metrics": [
{"fund_id": "asdf", "rounds": [{"round_id": "123", "application_statuses": {"NOT_STARTED": 12}}]}
]
}
)
print("hello")
current_app.logger.warning("hello")
if not round_id and not fund_id:
print("No params")
return jsonify({"code": 404, "message": "No funds or rounds specified"})
Expand Down
3 changes: 2 additions & 1 deletion config/envs/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DefaultConfig:
FLASK_ROOT = str(Path(__file__).parent.parent.parent)
FLASK_ENV = CommonConfig.FLASK_ENV
FORCE_HTTPS = CommonConfig.FORCE_HTTPS
FSD_LOG_LEVEL = CommonConfig.FSD_LOG_LEVEL
FSD_LOG_LEVEL = "DEBUG"

# ---------------
# APIs Config: contains api hosts (set in manifest.yml)
Expand Down Expand Up @@ -71,6 +71,7 @@ class DefaultConfig:
# S3 Config
# ---------------
AWS_MSG_BUCKET_NAME = environ.get("AWS_MSG_BUCKET_NAME")
AWS_BUCKET_NAME = environ.get("AWS_BUCKET_NAME")
# ---------------
# Task Executor Config
# ---------------
Expand Down
4 changes: 3 additions & 1 deletion config/envs/unit_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UnitTestingConfig(DefaultConfig):

WARN_IF_QUERIES_OVER_MS = 5

SQLALCHEMY_DATABASE_URI = DefaultConfig.SQLALCHEMY_DATABASE_URI + "_UNIT_TEST"
SQLALCHEMY_DATABASE_URI = DefaultConfig.SQLALCHEMY_DATABASE_URI + "_unit_test"

# ---------------
# Task Executor Config
Expand All @@ -46,3 +46,5 @@ class UnitTestingConfig(DefaultConfig):
SQS_BATCH_SIZE = 10 # MaxNumber Of Messages to process
SQS_VISIBILITY_TIME = 1 # time for message to temporarily invisible to others (in sec)
SQS_RECEIVE_MESSAGE_CYCLE_TIME = 5 # Run the job every 'x' seconds

USE_LOCAL_DATA = True
Loading

0 comments on commit 76792cb

Please sign in to comment.