Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Addign unittest for nyse symbols preprocessor #42

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion tests/nasdaqapi/test_preprocessor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import json
import os

from stocklake.nasdaqapi.preprocessor import NASDAQSymbolsPreprocessor
from stocklake.nasdaqapi.preprocessor import (
AMEXSymbolsPreprocessor,
NASDAQSymbolsPreprocessor,
)
from stocklake.stores.artifact.local_artifact_repo import LocalArtifactRepository

SAMPLE_RESPONSE_JSON = "./tests/nasdaqapi/sample_response.json"
Expand All @@ -27,3 +30,15 @@ def test_NASDAQSymbolsPreprocessor(tmpdir):
assert not os.path.exists(preprocessor.artifact_path)
preprocessor.process()
assert os.path.exists(preprocessor.artifact_path)


def test_AMEXSymbolsPreprocessor(tmpdir):
datafile_path = _download_data(tmpdir)
preprocessor = AMEXSymbolsPreprocessor(
LocalArtifactRepository(tmpdir), datafile_path
)

# check no artifact exists before run
assert not os.path.exists(preprocessor.artifact_path)
preprocessor.process()
assert os.path.exists(preprocessor.artifact_path)
Loading