fixed backend tests
This commit is contained in:
@@ -37,15 +37,13 @@ void QueryFixture::check_table_not_exists(const std::string &table_name) const
|
||||
}
|
||||
|
||||
void QueryFixture::drop_table_if_exists(const std::string &table_name) const {
|
||||
const auto result = db.exists(table_name).and_then([&table_name, this](bool exists) {
|
||||
const auto result = db.exists(table_name).and_then([&table_name, this](const bool exists) {
|
||||
if (exists) {
|
||||
if (query::query::drop()
|
||||
.table(table_name)
|
||||
.execute(db).is_ok()) {
|
||||
this->check_table_not_exists(table_name);
|
||||
} else {
|
||||
FAIL("Failed to drop table");
|
||||
}
|
||||
auto res = query::query::drop()
|
||||
.table(table_name)
|
||||
.execute(db);
|
||||
REQUIRE(res);
|
||||
this->check_table_not_exists(table_name);
|
||||
}
|
||||
return utils::ok(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user