-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): verify that selected filings exist in the test repo
- Loading branch information
Showing
9 changed files
with
93 additions
and
9 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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
accession_numbers: | ||
- 0000320193-23-000077 # 10-Q AAPL Apple Inc. | ||
- 0000320193-23-000077 # 10-Q AAPL Apple Inc. 2023-08-04 | ||
- 0000950170-23-014423 # 10-Q MSFT Microsoft Corp 2023-04-25 | ||
- 0001652044-23-000094 # 10-Q GOOG Alphabet Inc. 2023-10-25 | ||
- 0001652044-23-000070 # 10-Q GOOG Alphabet Inc. 2023-07-26 | ||
- 0001326801-19-000037 # 10-Q META Meta Platforms Inc. 2019-04-25 |
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
21 changes: 21 additions & 0 deletions
21
tests/accuracy/structure_and_text/test_selected_filings.py
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,21 @@ | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
from tests.utils import traverse_repository_for_filings | ||
|
||
DEFAULT_YAML = Path(__file__).parent / "selected-filings.yaml" | ||
|
||
|
||
def test_filings_exist(): | ||
with DEFAULT_YAML.open("r") as file: | ||
selected_filings = yaml.safe_load(file) | ||
accession_numbers = list(selected_filings["accession_numbers"]) | ||
assert accession_numbers, "No accession numbers found in YAML file." | ||
|
||
existing_numbers = { | ||
report.accession_number for report in traverse_repository_for_filings() | ||
} | ||
|
||
for accession_number in accession_numbers: | ||
assert accession_number in existing_numbers, f"Missing {accession_number}" |
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,21 @@ | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
from tests.utils import traverse_repository_for_filings | ||
|
||
DEFAULT_YAML = Path(__file__).parent / "selected-filings.yaml" | ||
|
||
|
||
def test_filings_exist(): | ||
with DEFAULT_YAML.open("r") as file: | ||
selected_filings = yaml.safe_load(file) | ||
accession_numbers = list(selected_filings["accession_numbers"]) | ||
assert accession_numbers, "No accession numbers found in YAML file." | ||
|
||
existing_numbers = { | ||
report.accession_number for report in traverse_repository_for_filings() | ||
} | ||
|
||
for accession_number in accession_numbers: | ||
assert accession_number in existing_numbers, f"Missing {accession_number}" |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
accession_numbers: | ||
- 0000320193-23-000077 # 10-Q AAPL Apple | ||
- 0001652044-23-000070 # 10-Q GOOG Alphabet | ||
- 0000320193-23-000077 # 10-Q AAPL Apple Inc. 2023-08-04 | ||
- 0000950170-23-014423 # 10-Q MSFT Microsoft Corp 2023-04-25 | ||
- 0001652044-23-000094 # 10-Q GOOG Alphabet Inc. 2023-10-25 | ||
- 0001652044-23-000070 # 10-Q GOOG Alphabet Inc. 2023-07-26 | ||
- 0001326801-19-000037 # 10-Q META Meta Platforms Inc. 2019-04-25 |
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 @@ | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
from tests.utils import traverse_repository_for_filings | ||
|
||
DEFAULT_YAML = Path(__file__).parent / "selected-filings.yaml" |