Skip to content

Commit

Permalink
remove FakeDatabaseConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Dec 22, 2023
1 parent e55dd68 commit 805003b
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions pvconsumer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,34 +78,5 @@ def format_pv_data(pv_system: SiteSQL, pv_yield_df: pd.DataFrame, session: Sessi
return pv_yield_df


class FakeDatabaseConnection:
"""Fake Database connection class"""

def __init__(self):
"""
Set up fake database connection
This is so we can still do
'with connection.get_session() as sessions:'
bu session is None
"""

class FakeSession:
def __init__(self): # noqa
pass

def __enter__(self): # noqa
return None

def __exit__(self, type, value, traceback): # noqa
pass

self.Session = FakeSession

def get_session(self) -> Session:
"""Get sqlalamcy session"""
return self.Session()


pv_output = "pvoutput.org"
solar_sheffield_passiv = "solar_sheffield_passiv"

0 comments on commit 805003b

Please sign in to comment.