-
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.
libcovebods: Fixup statistics for BODS 0.4
- Loading branch information
Ed (ODSC)
committed
Oct 2, 2024
1 parent
e2e626a
commit 5216c9f
Showing
4 changed files
with
96 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
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,39 @@ | ||
import os | ||
import tempfile | ||
|
||
from tests.api import bods_json_output | ||
|
||
|
||
def test_sample_mode_valid_1(): | ||
|
||
cove_temp_folder = tempfile.mkdtemp( | ||
prefix="lib-cove-bods-tests-", dir=tempfile.gettempdir() | ||
) | ||
json_filename = os.path.join( | ||
os.path.dirname(os.path.realpath(__file__)), | ||
"fixtures", | ||
"0.4", | ||
"sample_300_statements.json", | ||
) | ||
|
||
results = bods_json_output(cove_temp_folder, json_filename, sample_mode=True) | ||
|
||
print(results) | ||
|
||
assert results["schema_version"] == "0.4" | ||
|
||
assert results['statistics']['count_entity_statements'] == 50 | ||
assert results['statistics']['count_entity_statements_types']['registeredEntity'] == 50 | ||
assert results['statistics']['count_entity_statements_types_with_any_identifier']['registeredEntity'] == 50 | ||
assert results['statistics']['count_entity_statements_types_with_any_identifier_with_id_and_scheme']['registeredEntity'] == 50 | ||
assert results['statistics']['count_person_statements'] == 50 | ||
assert results['statistics']['count_person_statements_types']['knownPerson'] == 50 | ||
assert results['statistics']['count_ownership_or_control_statement'] == 50 | ||
assert results['statistics']['count_ownership_or_control_statement_interested_party'] == 50 | ||
assert results['statistics']['count_ownership_or_control_statement_interest_statement_types']['shareholding'] == 50 | ||
assert results['statistics']['count_ownership_or_control_statement_by_year'][2020] == 50 | ||
assert results['statistics']['count_ownership_or_control_statement_subject_by_year'][2020] == 50 | ||
assert results['statistics']['count_ownership_or_control_statement_interested_party_by_year'][2020] == 50 | ||
|
||
|
||
#'count_declaration_subjects': 50, 'count_records_current': 150, 'count_new_records_missing': 0 |