-
I have done some refactoring on internal stage/location related logic. Now I want to do some unit tests for them to avoid them being broken by mistake. pub async fn parse_stage_location(
ctx: &Arc<QueryContext>,
location: &str,
) -> Result<(UserStageInfo, String)> {}
pub fn parse_uri_location(
location: &str,
credential_options: &BTreeMap<String, String>,
encryption_options: &BTreeMap<String, String>,
) -> Result<(UserStageInfo, String)> {} However, let mgr = ctx.get_user_manager();
let stage = mgr.get_stage(&ctx.get_tenant(), names[0]).await?; How to construct a |
Beta Was this translation helpful? Give feedback.
Answered by
Xuanwo
Jun 6, 2022
Replies: 1 comment 1 reply
-
let ctx = create_query_context().await?;
let user_stage_info = UserStageInfo {
stage_name: "test".to_string(),
stage_type: StageType::Internal,
..Default::default()
};
// Add an internal stage for testing.
ctx.get_user_manager()
.add_stage(&ctx.get_tenant(), user_stage_info.clone(), false)
.await?; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Xuanwo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ctx.get_user_manager().add_stage()
works.