From e99fa0c66e0a0813c8c2562b2b88b94ba3df8cb0 Mon Sep 17 00:00:00 2001 From: Jan Range Date: Sat, 25 May 2024 17:43:38 +0200 Subject: [PATCH] update test cases --- tests/data/expected_json_schema.json | 5 ++- tests/data/expected_sdrdm_schema.json | 53 +++++++++++++++++++-------- tests/data/model.md | 8 +++- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/tests/data/expected_json_schema.json b/tests/data/expected_json_schema.json index 34d4e87..71dc6c3 100644 --- a/tests/data/expected_json_schema.json +++ b/tests/data/expected_json_schema.json @@ -14,7 +14,10 @@ }, "test2": { "title": "Test2", - "$ref": "#/definitions/Test2", + "type": "array", + "items": { + "$ref": "#/definitions/Test2" + }, "term": "schema:something" } }, diff --git a/tests/data/expected_sdrdm_schema.json b/tests/data/expected_sdrdm_schema.json index acb01f1..0132380 100644 --- a/tests/data/expected_sdrdm_schema.json +++ b/tests/data/expected_sdrdm_schema.json @@ -1,14 +1,5 @@ { "name": "Test", - "config": { - "id-field": true, - "prefixes": { - "schema": "http://schema.org/" - }, - "nsmap": { - "tst": "http://example.com/test/" - } - }, "objects": [ { "name": "Test", @@ -20,7 +11,11 @@ "docstring": "", "options": [], "term": "schema:hello", - "required": true + "required": true, + "xml": { + "is_attr": true, + "name": "name" + } }, { "name": "number", @@ -29,16 +24,24 @@ "docstring": "", "options": [], "term": "schema:one", - "required": false + "required": false, + "xml": { + "is_attr": true, + "name": "number" + } }, { "name": "test2", - "multiple": false, + "multiple": true, "dtypes": ["Test2"], "docstring": "", "options": [], "term": "schema:something", - "required": false + "required": false, + "xml": { + "is_attr": false, + "name": "SomeTest2" + } } ], "docstring": "", @@ -54,7 +57,11 @@ "docstring": "", "options": [], "term": "schema:hello", - "required": false + "required": false, + "xml": { + "is_attr": false, + "name": "name" + } }, { "name": "number", @@ -63,11 +70,25 @@ "docstring": "", "options": [], "term": "schema:one", - "required": false + "required": false, + "xml": { + "is_attr": true, + "name": "number" + } } ], "docstring": "", "object_type": "Object" } - ] + ], + "config": { + "id-field": true, + "prefixes": { + "schema": "http://schema.org/" + }, + "nsmap": { + "tst": "http://example.com/test/" + }, + "repo": "https://www.github.com/my/repo" + } } diff --git a/tests/data/model.md b/tests/data/model.md index 7a816a3..9625966 100644 --- a/tests/data/model.md +++ b/tests/data/model.md @@ -1,5 +1,6 @@ --- id-field: true +repo: "https://www.github.com/my/repo" prefixes: schema: http://schema.org/ nsmap: @@ -15,18 +16,23 @@ nsmap: - __name__ - Type: string - Term: schema:hello + - XML: @name - number - Type: float - Term: schema:one + - XML: @number - test2 - - Type: Test2 + - Type: Test2[] - Term: schema:something + - XML: SomeTest2 ### Test2 - names - Type: string[] - Term: schema:hello + - XML: name - number - Type: float - Term: schema:one + - XML: @number