Skip to content

Commit f2af08e

Browse files
committed
fix test
1 parent 23c4915 commit f2af08e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

spi/spi-conf/tests/spi_conf_api_test.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@ async fn spi_conf_namespace_test() -> TardisResult<()> {
3030
start_web_server().await?;
3131
let tardis_ctx = TardisContext::default();
3232
let mut client = TestHttpClient::new("https://localhost:8080/spi-conf".to_string());
33-
client.set_auth(&tardis_ctx)?;
33+
client.set_auth(&TardisContext {
34+
own_paths: "t1/app001".to_string(),
35+
ak: "".to_string(),
36+
roles: vec![],
37+
groups: vec![],
38+
owner: "app001".to_string(),
39+
..Default::default()
40+
})?;
3441
let funs = TardisFuns::inst_with_db_conn(DOMAIN_CODE.to_string(), None);
3542
let RegisterResponse { username, password } = client
3643
.put(
@@ -49,14 +56,7 @@ async fn spi_conf_namespace_test() -> TardisResult<()> {
4956
)
5057
.await;
5158
log::info!("username: {username}, password: {password}");
52-
client.set_auth(&TardisContext {
53-
own_paths: "t1/app001".to_string(),
54-
ak: "".to_string(),
55-
roles: vec![],
56-
groups: vec![],
57-
owner: "app001".to_string(),
58-
..Default::default()
59-
})?;
59+
6060
test_register(&mut client).await?;
6161
test_curd(&mut client).await?;
6262
test_tags(&mut client).await?;
@@ -123,7 +123,7 @@ pub async fn test_curd(client: &mut TestHttpClient) -> TardisResult<()> {
123123
assert_eq!(_response.config_count, 1);
124124
// 4.1 get namespace list
125125
let _response = client.get::<Vec<NamespaceItem>>("/ci/namespace/list").await;
126-
assert_eq!(_response.len(), 3);
126+
assert_eq!(_response.len(), 4);
127127
// since we have published a config, the config_count should be 1
128128
// 5. delete config
129129
client.delete("/ci/cs/config?namespace_id=public&group=DEFAULT-GROUP&data_id=conf-default").await;

0 commit comments

Comments
 (0)