def test_evaluate_skip_condition_returns_false_when_no_skip_condition( self): # Given skip_conditions = None answer_store = AnswerStore() current_location = Location(section_id="some-section", block_id="some-block") path_finder = PathFinder( get_schema(), answer_store, list_store=ListStore(), metadata={}, progress_store=ProgressStore(), response_metadata={}, ) routing_path_block_ids = [] # When condition = path_finder.evaluate_skip_conditions( current_location, routing_path_block_ids, skip_conditions) # Then self.assertFalse(condition)
def test_evaluate_skip_condition_returns_false_when_both_or_rules_false( self): # Given skip_conditions = [ { "when": [{ "id": "this", "condition": "equals", "value": "value" }] }, { "when": [{ "id": "that", "condition": "equals", "value": "other value" }] }, ] answer_store = AnswerStore() answer_store.add_or_update( Answer(answer_id="this", value="not correct")) answer_store.add_or_update( Answer(answer_id="that", value="not correct")) current_location = Location(section_id="some-section", block_id="some-block") path_finder = PathFinder( get_schema(), answer_store, list_store=ListStore(), metadata={}, progress_store=ProgressStore(), response_metadata={}, ) routing_path_block_ids = [] # When condition = path_finder.evaluate_skip_conditions( current_location, routing_path_block_ids, skip_conditions) # Then self.assertFalse(condition)