Skip to content

Commit

Permalink
Merge pull request #42 from tsugumi-sys/adding-unittest-NYSESymbolsPr…
Browse files Browse the repository at this point in the history
…eprocessor

Test: Addign unittest for nyse symbols preprocessor
  • Loading branch information
tsugumi-sys authored Apr 28, 2024
2 parents 73e8fcf + 1665da0 commit 641b2ff
Showing 1 changed file with 16 additions and 1 deletion.
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)

0 comments on commit 641b2ff

Please sign in to comment.