def take_action(self, parsed_args): """Take validation action""" # Get parameters: validation_dir = parsed_args.validation_dir validation_name = parsed_args.validation_name v_actions = ValidationActions(validation_path=validation_dir) data = v_actions.show_validations(validation_name) if data: return data.keys(), data.values()
def test_validation_show(self, mock_exists, mock_open, mock_parse_validation, mock_data, mock_log): data = { 'Name': 'Advanced Format 512e Support', 'Description': 'foo', 'Groups': ['prep', 'pre-deployment'], 'ID': '512e', 'Parameters': {} } data.update({ 'Last execution date': '2019-11-25 13:40:14', 'Number of execution': 'Total: 1, Passed: 0, Failed: 1' }) validations_show = ValidationActions() out = validations_show.show_validations('512e') self.assertEqual(out, data)