Skip to content

Commit 3523097

Browse files
committed
use_keyspace it: teardown keyspaces
1 parent 4feef40 commit 3523097

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

scylla/tests/integration/session/use_keyspace.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ async fn test_use_keyspace() {
9898
rows2.sort();
9999

100100
assert_eq!(rows2, vec!["test1".to_string(), "test2".to_string()]);
101+
102+
session.ddl(format!("DROP KEYSPACE {ks}")).await.unwrap();
101103
}
102104

103105
#[tokio::test]
@@ -157,7 +159,7 @@ async fn test_use_keyspace_case_sensitivity() {
157159

158160
// Use uppercase keyspace with case sensitivity
159161
// Should select the uppercase one
160-
session.use_keyspace(ks_upper, true).await.unwrap();
162+
session.use_keyspace(&ks_upper, true).await.unwrap();
161163

162164
let rows: Vec<String> = session
163165
.query_unpaged("SELECT * from tab", &[])
@@ -171,6 +173,15 @@ async fn test_use_keyspace_case_sensitivity() {
171173
.collect();
172174

173175
assert_eq!(rows, vec!["uppercase".to_string()]);
176+
177+
session
178+
.ddl(format!("DROP KEYSPACE \"{ks_lower}\""))
179+
.await
180+
.unwrap();
181+
session
182+
.ddl(format!("DROP KEYSPACE \"{ks_upper}\""))
183+
.await
184+
.unwrap();
174185
}
175186

176187
#[tokio::test]
@@ -221,6 +232,8 @@ async fn test_raw_use_keyspace() {
221232
.query_unpaged(format!("use {} ;", ks.to_uppercase()), &[])
222233
.await
223234
.is_ok());
235+
236+
session.ddl(format!("DROP KEYSPACE {ks}")).await.unwrap();
224237
}
225238

226239
#[tokio::test]
@@ -246,4 +259,6 @@ async fn test_get_keyspace_name() {
246259
.await
247260
.unwrap();
248261
assert_eq!(*session.get_keyspace().unwrap(), ks);
262+
263+
session.ddl(format!("DROP KEYSPACE {ks}")).await.unwrap();
249264
}

0 commit comments

Comments
 (0)