Skip to content

Commit

Permalink
Move a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewLester committed Apr 24, 2023
1 parent 2ba444d commit bef56d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
21 changes: 9 additions & 12 deletions pv_site_api/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Main API Routes"""
import asyncio
import logging
import os

import httpx
import pandas as pd
import sentry_sdk
import structlog
import httpx
from dotenv import load_dotenv
from fastapi import Depends, FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
Expand Down Expand Up @@ -60,14 +58,6 @@

logger = structlog.stdlib.get_logger()

enode_auth = EnodeAuth(
os.getenv("ENODE_CLIENT_ID", ""),
os.getenv("ENODE_CLIENT_SECRET", ""),
os.getenv("ENODE_TOKEN_URL", ""),
)

enode_api_base_url = os.getenv("ENODE_API_BASE_URL", "https://enode-api.sandbox.enode.io")


def traces_sampler(sampling_context):
"""
Expand Down Expand Up @@ -124,7 +114,14 @@ def is_fake():
api_audience=os.getenv("AUTH0_API_AUDIENCE"),
algorithm=os.getenv("AUTH0_ALGORITHM"),
)
auth = EnodeAuth()

enode_auth = EnodeAuth(
os.getenv("ENODE_CLIENT_ID", ""),
os.getenv("ENODE_CLIENT_SECRET", ""),
os.getenv("ENODE_TOKEN_URL", ""),
)

enode_api_base_url = os.getenv("ENODE_API_BASE_URL", "https://enode-api.sandbox.enode.io")

# name the api
# test that the routes are there on swagger
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
InverterSQL,
SiteSQL,
StatusSQL,
InverterSQL,
)
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_post_site_fake(client, fake):
def test_post_site(db_session, client, clients):
# make site object
pv_site = PVSiteMetadata(
client_name="test_client",
client_name="test_client_1",
client_site_id=1,
client_site_name="the site name",
region="the site's region",
Expand Down

0 comments on commit bef56d8

Please sign in to comment.