Update unit tests to mock datasets properly
This commit is contained in:
parent
de9e668a72
commit
56bb676545
|
@ -488,16 +488,19 @@ pub mod tests {
|
||||||
|
|
||||||
// Mock a database file in transient memory
|
// Mock a database file in transient memory
|
||||||
pub fn mock_datasets() -> sqlite::Result<Connection> {
|
pub fn mock_datasets() -> sqlite::Result<Connection> {
|
||||||
let query = "
|
let query = "PRAGMA foreign_keys = ON;
|
||||||
PRAGMA foreign_keys = ON;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS datasets (
|
CREATE TABLE IF NOT EXISTS datasets (
|
||||||
name TEXT UNIQUE NOT NULL,
|
name TEXT UNIQUE NOT NULL,
|
||||||
last_sync INTEGER NOT NULL,
|
last_sync INTEGER NOT NULL,
|
||||||
game_id INTEGER NOT NULL,
|
game_id INTEGER NOT NULL,
|
||||||
game_name TEXT NOT NULL,
|
game_name TEXT NOT NULL,
|
||||||
state TEXT
|
country TEXT,
|
||||||
) STRICT;";
|
state TEXT,
|
||||||
|
decay_rate REAL NOT NULL,
|
||||||
|
period REAL NOT NULL,
|
||||||
|
tau REAL NOT NULL
|
||||||
|
) STRICT;";
|
||||||
|
|
||||||
let connection = sqlite::open(":memory:")?;
|
let connection = sqlite::open(":memory:")?;
|
||||||
connection.execute(query)?;
|
connection.execute(query)?;
|
||||||
|
|
Loading…
Reference in a new issue