def test_schema(log_name): dr = dummy_request() dr.matchdict["log_name"] = log_name expected_return_code = 200 with patch('mycroft.views.schema.s3_bucket_action') as bucket_action: bucket_action.return_value = {} actual_return_code, _ = schema(dr) assert actual_return_code == expected_return_code
def test_schema_errors(err_instance, expected_return_code): dr = dummy_request() with patch('mycroft.views.schema.s3_bucket_action') as bucket_action: bucket_action.side_effect = err_instance actual_return_code, _ = schema(dr) assert actual_return_code == expected_return_code