tmt.export package
Submodules
tmt.export.nitrate module
- class tmt.export.nitrate.NitrateExporter
Bases:
ExportPlugin
- tmt.export.nitrate.add_to_nitrate_runs(nitrate_case: Any, general_plan: Any, test: Test, dry_mode: bool) None
Add nitrate test case to all active runs under given general plan
Go down plan tree from general plan, add case and case run to all open runs. Try to apply adjust.
- tmt.export.nitrate.convert_manual_to_nitrate(test_md: Path) tuple[str, str, str, str]
Convert Markdown document to html sections.
These sections can be exported to nitrate. Expects: Markdown document as a file. Returns: tuple of (step, expect, setup, cleanup) sections as html strings.
- tmt.export.nitrate.create_nitrate_case(summary: str, category: str) Any
Create new nitrate case
- tmt.export.nitrate.enabled_for_environment(test: Test, tcms_notes: str) bool
Check whether test is enabled for specified environment
- tmt.export.nitrate.enabled_somewhere(test: Test) bool
True if the test is enabled for some context (adjust rules)
- tmt.export.nitrate.find_general_plan(component: str) Any
Return single General Test Plan or raise an error
- tmt.export.nitrate.get_category(path: Path) str
Get category from Makefile
- tmt.export.nitrate.import_nitrate() Any
Conditionally import the nitrate module
- tmt.export.nitrate.prepare_extra_summary(test: Test, append_summary: bool) str
extra-summary for export –create test
- tmt.export.nitrate.return_markdown_file() Path | None
Return path to the markdown file
tmt.export.polarion module
- class tmt.export.polarion.PolarionExporter
Bases:
ExportPlugin
- tmt.export.polarion.add_hyperlink(polarion_case: None, link: str, role: str = 'testscript') None
Add new hyperlink to a Polarion case and check/remove duplicates
- tmt.export.polarion.create_polarion_case(summary: str, project_id: str, path: Path) None
Create new polarion case
- tmt.export.polarion.export_to_polarion(test: Test) None
Export fmf metadata to a Polarion test case
- tmt.export.polarion.find_polarion_case_ids(data: dict[str, str | None], preferred_project: str | None = None, polarion_case_id: str | None = None) tuple[str, str | None]
Find IDs for Polarion case from data dictionary
- tmt.export.polarion.get_polarion_case(data: dict[str, str | None], preferred_project: str | None = None, polarion_case_id: str | None = None) None
Get Polarion case through couple different methods
- tmt.export.polarion.get_polarion_ids(query_result: list[Any], preferred_project: str | None = None) tuple[str, str | None]
Return case and project ids from query results
- tmt.export.polarion.import_polarion() None
Import polarion python api - pylero
tmt.export.rst module
- class tmt.export.rst.RestructuredExporter
Bases:
ExportPlugin
tmt.export.template module
- class tmt.export.template.TemplateExporter
Bases:
ExportPlugin- classmethod export_fmfid_collection(fmf_ids: list[FmfId], keys: list[str] | None = None, template: Path | None = None, **kwargs: Any) str
Export collection of fmf ids
- classmethod export_plan_collection(plans: list[Plan], keys: list[str] | None = None, template: Path | None = None, **kwargs: Any) str
Export collection of plans
- classmethod export_story_collection(stories: list[Story], keys: list[str] | None = None, template: Path | None = None, include_title: bool = True, **kwargs: Any) str
Export collection of stories
- classmethod export_test_collection(tests: list[Test], keys: list[str] | None = None, template: Path | None = None, **kwargs: Any) str
Export collection of tests
- classmethod render_template(*, template_filepath: Path | None = None, default_template_filename: str, keys: list[str] | None = None, **variables: Any) str
tmt.export.yaml module
- class tmt.export.yaml.YAMLExporter
Bases:
TrivialExporter
Module contents
Metadata export functionality core.
Internal APIs, plugin classes and shared functionality and helpers for metadata export of tests, plans or stories.
- class tmt.export.ExportPlugin
Bases:
objectBase class for plugins providing metadata export functionality
- classmethod export_fmfid_collection(fmf_ids: list[FmfId], **kwargs: Any) str
Export collection of fmf ids
- classmethod export_plan_collection(plans: list[Plan], keys: list[str] | None = None, **kwargs: Any) str
Export collection of plans
- class tmt.export.Exportable(*args: Any, **kwargs: Any)
Bases:
Generic[ExportableT],_CommonBaseMixin class adding support for exportability of class instances
- export(*, format: str, keys: list[str] | None = None, **kwargs: Any) str
Export this instance in a given format
- classmethod export_collection(*, collection: list[ExportableT], format: str, keys: list[str] | None = None, **kwargs: Any) str
Export collection of instances in a given format
- classmethod get_export_plugin_registry() PluginRegistry[type[ExportPlugin]]
Return - or initialize - export plugin registry
- classmethod provides_export(format: str) Callable[[type[ExportPlugin]], type[ExportPlugin]]
A decorator for registering export format.
Decorate an export plugin class to register a format.
- class tmt.export.Exporter(*args, **kwargs)
Bases:
Protocol
- class tmt.export.TrivialExporter
Bases:
ExportPluginA helper base class for exporters with trivial export procedure.
Child classes need to implement a single method that performs a conversion of a single collection item, and that’s all. It is good enough for formats like
dictorYAMLas they do not require any other input than the data to convert.- classmethod export_fmfid_collection(fmf_ids: list[FmfId], keys: list[str] | None = None, **kwargs: Any) str
Export collection of fmf ids
- classmethod export_plan_collection(plans: list[Plan], keys: list[str] | None = None, **kwargs: Any) str
Export collection of plans
- tmt.export.bz_set_coverage(bug_ids: list[int], case_id: str, tracker_id: int) None
Set coverage in Bugzilla
- tmt.export.check_md_file_respects_spec(md_path: Path) list[str]
Check that the file respects manual test specification
Return list of warnings, empty list if no problems found.
- tmt.export.get_bz_instance() Any
Import the bugzilla module and return BZ instance