Skip to content

TEST: Add unit tests for pyrit/models/ module#1601

Open
romanlutz wants to merge 1 commit intomicrosoft:mainfrom
romanlutz:test/models-coverage
Open

TEST: Add unit tests for pyrit/models/ module#1601
romanlutz wants to merge 1 commit intomicrosoft:mainfrom
romanlutz:test/models-coverage

Conversation

@romanlutz
Copy link
Copy Markdown
Contributor

Summary

Adds unit tests for 10 previously untested model files including seed models.

New Test Files

Source File Tests Coverage
chat_message.py 17 ToolCall, ChatMessage (init, serialization, roles), ChatMessagesDataset
conversation_reference.py 10 ConversationType enum, frozen dataclass, hash, equality
conversation_stats.py 5 Defaults, values, frozen immutability
question_answering.py 14 QuestionChoice, QuestionAnsweringEntry, Dataset
scenario_result.py 12 ScenarioIdentifier, ScenarioResult (strategies, objectives, success rate)
strategy_result.py 3 duplicate() deep copy, independence
seeds/seed_attack_group.py 7 Valid init, objective property, validation errors
seeds/seed_dataset.py 18 Init, get_values, random, from_dict, grouping, deprecation
seeds/seed_objective.py 7 Init, data_type, technique errors, Jinja rendering
seeds/seed_prompt.py 14 Init, data_type inference, from_messages

Testing

All 121 tests pass locally.

Adds tests for 10 previously untested model files:
- chat_message.py (ToolCall, ChatMessage, ChatMessagesDataset)
- conversation_reference.py (frozen, hash, equality)
- conversation_stats.py (defaults, frozen)
- question_answering.py (QuestionChoice, QuestionAnsweringEntry)
- scenario_result.py (ScenarioIdentifier, ScenarioResult)
- strategy_result.py (duplicate, deep copy)
- seeds: seed_attack_group.py, seed_dataset.py,
  seed_objective.py, seed_prompt.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant