-
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.
* Add ingest json builder * wip * Fixes * Add json builder helper function and replace test files in integration tests * Replace test json in unit tests with builder * Bump patch version * Bump patch version * Refactor to make test data creation more readable * Simplify adjusting test data with destructuring
- Loading branch information
Showing
9 changed files
with
234 additions
and
381 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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "admin_backend" | ||
version = "2.17.15" | ||
version = "2.17.16" | ||
description = "" | ||
authors = ["CPR-dev-team <[email protected]>"] | ||
packages = [{ include = "app" }, { include = "tests" }] | ||
|
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,48 @@ | ||
import json | ||
import logging | ||
from io import BytesIO | ||
from typing import Any | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
default_collection = { | ||
"import_id": "test.new.collection.0", | ||
"title": "Test title", | ||
"description": "Test description", | ||
} | ||
|
||
|
||
default_family = { | ||
"import_id": "test.new.family.0", | ||
"title": "Test", | ||
"summary": "Test", | ||
"geographies": ["South Asia"], | ||
"category": "UNFCCC", | ||
"metadata": {"author_type": ["Non-Party"], "author": ["Test"]}, | ||
"collections": ["test.new.collection.0"], | ||
} | ||
|
||
|
||
default_document = { | ||
"import_id": "test.new.document.0", | ||
"family_import_id": "test.new.family.0", | ||
"metadata": {"role": ["MAIN"], "type": ["Law"]}, | ||
"variant_name": None, | ||
"title": "", | ||
"user_language_name": "", | ||
} | ||
|
||
|
||
default_event = { | ||
"import_id": "test.new.event.0", | ||
"family_import_id": "test.new.family.0", | ||
"event_title": "Test", | ||
"date": "2024-01-01", | ||
"event_type_value": "Amended", | ||
} | ||
|
||
|
||
def build_json_file(data: dict[str, Any]) -> BytesIO: | ||
json_data = json.dumps(data).encode("utf-8") | ||
return BytesIO(json_data) |
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
tests/integration_tests/ingest/test_bulk_data_with_invalid_event_type.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.