-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from awhipp/tests/add_stream_service_tests
fix: ✅ Added tests for the stream service
- Loading branch information
Showing
9 changed files
with
277 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Forex Data Model used in TimeScaleDB""" | ||
|
||
from datetime import datetime | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class ForexData(BaseModel): | ||
"""TimescaleDB model for forex data.""" | ||
|
||
instrument: str | ||
time: datetime | ||
bid: float | ||
ask: float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Test configuration for Foresight.""" | ||
|
||
import uuid | ||
|
||
import pytest | ||
|
||
from foresight.stream_service.app import create_table | ||
from foresight.utils.database import TimeScaleService | ||
|
||
|
||
@pytest.fixture() | ||
def create_timescale_table(): | ||
"""Create a table in the TimescaleDB.""" | ||
table_name = create_table(table_name=f"forex_data_{str(uuid.uuid4())[0:4]}") | ||
yield table_name | ||
TimeScaleService().execute(query=f"DROP TABLE {table_name}") |
Empty file.
Oops, something went wrong.