Skip to content

TEST: add unit tests for ConverterRegistry#1440

Merged
spencrr merged 1 commit intomicrosoft:mainfrom
spencrr:spencrr/registry-tests
Mar 9, 2026
Merged

TEST: add unit tests for ConverterRegistry#1440
spencrr merged 1 commit intomicrosoft:mainfrom
spencrr:spencrr/registry-tests

Conversation

@spencrr
Copy link
Copy Markdown
Collaborator

@spencrr spencrr commented Mar 5, 2026

Description

Add unit tests for ConverterRegistry covering:

  • Singleton pattern (creation, identity, reset)
  • Instance registration with custom and auto-generated names
  • Duplicate-name registration (overwrite behavior)
  • Instance retrieval by name (found and not-found cases)
  • Metadata building and ComponentIdentifier integration
  • Metadata filtering by class name, input type, and combined include/exclude
  • Inherited BaseInstanceRegistry methods (__contains__, __len__, __iter__, get_names, get_all_instances)

Tests and Documentation

  • New test file: tests/unit/registry/test_converter_registry.py (26 tests)
  • No documentation changes needed (test-only PR)
  • JupyText not applicable (no notebook changes)

Copilot AI review requested due to automatic review settings March 5, 2026 02:42
@spencrr spencrr marked this pull request as draft March 5, 2026 02:42
@spencrr spencrr force-pushed the spencrr/registry-tests branch from bfcc00f to 5b7889f Compare March 5, 2026 02:44
@spencrr spencrr changed the title TEST add unit tests for ConverterRegistry [WIP] TEST add unit tests for ConverterRegistry Mar 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new unit test module for ConverterRegistry to validate basic singleton behavior, instance registration, metadata generation, and metadata filtering (via BaseInstanceRegistry.list_metadata) using lightweight mock converters.

Changes:

  • Added mock PromptConverter implementations (text, image, and multi-modal) for registry testing.
  • Added tests for ConverterRegistry singleton lifecycle, register_instance, get_instance_by_name, and inherited container behaviors.
  • Added tests for metadata contents and include/exclude filtering behavior.

You can also share your feedback on Copilot code review. Take the survey.

@spencrr spencrr changed the title [WIP] TEST add unit tests for ConverterRegistry TEST: add unit tests for ConverterRegistry Mar 7, 2026
@spencrr spencrr force-pushed the spencrr/registry-tests branch from 5b7889f to 03d324f Compare March 7, 2026 01:41
@spencrr spencrr marked this pull request as ready for review March 7, 2026 01:41
Copy link
Copy Markdown
Contributor

@rlundeen2 rlundeen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

@spencrr spencrr merged commit 9228ad9 into microsoft:main Mar 9, 2026
42 checks passed
riyosha pushed a commit to riyosha/PyRIT that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants