Skip to content

Commit

Permalink
areas tests: use more execute_batch()
Browse files Browse the repository at this point in the history
Change-Id: I4a14498582a33b8b713fcb480cc48e167b0ac493
  • Loading branch information
vmiklos committed Apr 23, 2024
1 parent 85730d2 commit 5699e66
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/areas/tests.rs
Expand Up @@ -3314,26 +3314,13 @@ fn test_relations_is_new() {
);
let file_system = context::tests::TestFileSystem::from_files(&files);
ctx.set_file_system(&file_system);
let mtime = ctx.get_time().now_string();
{
let conn = ctx.get_database_connection().unwrap();
conn.execute(
"insert into mtimes (page, last_modified) values (?1, ?2)",
["streets/myrelation", &mtime],
)
.unwrap();
conn.execute(
"insert into mtimes (page, last_modified) values (?1, ?2)",
["housenumbers/myrelation", &mtime],
)
.unwrap();
conn.execute(
r#"insert into osm_housenumber_coverages (relation_name, coverage, last_modified) values (?1, ?2, ?3)"#,
["myrelation", "", ""],
).unwrap();
conn.execute(
r#"insert into osm_street_coverages (relation_name, coverage, last_modified) values (?1, ?2, ?3)"#,
["myrelation", "", ""],
conn.execute_batch(
"insert into mtimes (page, last_modified) values ('streets/myrelation', '0');
insert into mtimes (page, last_modified) values ('housenumbers/myrelation', '0');
insert into osm_housenumber_coverages (relation_name, coverage, last_modified) values ('myrelation', '', '');
insert into osm_street_coverages (relation_name, coverage, last_modified) values ('myrelation', '', '');",
).unwrap();
}
let mut relations = Relations::new(&ctx).unwrap();
Expand Down

0 comments on commit 5699e66

Please sign in to comment.