schema_salad.tests.test_dlang_codegen

Test D code generation.

Attributes

cwl_file_uri

Classes

Names

Track name set and default namespace during parsing.

Functions

load_schema(schema_ref[, cache])

Load a schema that can be used to validate documents using load_and_validate.

test_cwl_dlang_gen(tmp_path)

End to end test of D generator using the CWL v1.0 schema.

dlang_codegen(file_uri, target)

Help using the D code generation function.

Module Contents

class schema_salad.tests.test_dlang_codegen.Names(default_namespace=None)

Track name set and default namespace during parsing.

Parameters:

default_namespace (Optional[str])

has_name(name_attr, space_attr)
Parameters:
  • name_attr (str)

  • space_attr (Optional[str])

Return type:

bool

get_name(name_attr, space_attr)

Fetch the stored schema for the given namespace.

Parameters:
  • name_attr (str)

  • space_attr (Optional[str])

Return type:

Optional[NamedSchema]

add_name(name_attr, space_attr, new_schema)

Add a new schema object to the name set.

Parameters:
  • name_attr (str) – name value read in schema

  • space_attr (Optional[str]) – namespace value read in schema.

  • new_schema (NamedSchema)

Returns:

the Name that was just added.

Return type:

Name

schema_salad.tests.test_dlang_codegen.load_schema(schema_ref, cache=None)

Load a schema that can be used to validate documents using load_and_validate.

Returns:

document_loader, avsc_names, schema_metadata, metaschema_loader

Parameters:
  • schema_ref (schema_salad.utils.ResolveType)

  • cache (Optional[schema_salad.utils.CacheType])

Return type:

schema_type

schema_salad.tests.test_dlang_codegen.cwl_file_uri
schema_salad.tests.test_dlang_codegen.test_cwl_dlang_gen(tmp_path)

End to end test of D generator using the CWL v1.0 schema.

Parameters:

tmp_path (pathlib.Path)

Return type:

None

schema_salad.tests.test_dlang_codegen.dlang_codegen(file_uri, target)

Help using the D code generation function.

Parameters:
Return type:

None