plexus.data.test_feedback_sampling module

Test cases for FeedbackItems sampling logic. Tests the different scenarios for prioritizing items with edit comments.

class plexus.data.test_feedback_sampling.MockFeedbackItem(item_id: str, initial_value: str, final_value: str, edit_comment: str = None, **kwargs)

Bases: object

Mock FeedbackItem for testing purposes.

__init__(item_id: str, initial_value: str, final_value: str, edit_comment: str = None, **kwargs)
class plexus.data.test_feedback_sampling.MockFeedbackItems

Bases: object

Mock FeedbackItems class with just the sampling method for testing.

class plexus.data.test_feedback_sampling.TestFeedbackItemsSampling(methodName='runTest')

Bases: TestCase

Test cases for FeedbackItems sampling logic.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()

Set up test fixtures.

test_edge_case_empty_items()

Test Edge Case: No items provided.

test_edge_case_limit_zero()

Test Edge Case: Limit is zero.

test_scenario_1_fewer_items_than_limit()

Test Scenario 1: If there are fewer items than the limit, take them all.

test_scenario_2_prioritize_edit_comments_with_room_for_others()

Test Scenario 2: More items than limit, but can fit all with edit comments plus some without.

test_scenario_3_more_items_with_comments_than_limit()

Test Scenario 3: More items with edit comments than the limit - randomly sample from them.

test_scenario_4_no_items_with_comments()

Test Scenario 4: No items have edit comments - randomly sample from all.

test_scenario_5_all_items_have_comments()

Test Scenario 5: All items have edit comments - randomly sample from all.

plexus.data.test_feedback_sampling.main()

Run all test cases.