From 56bb67654568262fe7bf289b1b378cdf3b73d9c4 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Fri, 13 Oct 2023 22:26:56 -0400 Subject: [PATCH] Update unit tests to mock datasets properly --- src/datasets.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/datasets.rs b/src/datasets.rs index aaea58c..37ac204 100644 --- a/src/datasets.rs +++ b/src/datasets.rs @@ -488,16 +488,19 @@ pub mod tests { // Mock a database file in transient memory pub fn mock_datasets() -> sqlite::Result { - let query = " - PRAGMA foreign_keys = ON; + let query = "PRAGMA foreign_keys = ON; - CREATE TABLE IF NOT EXISTS datasets ( - name TEXT UNIQUE NOT NULL, - last_sync INTEGER NOT NULL, - game_id INTEGER NOT NULL, - game_name TEXT NOT NULL, - state TEXT - ) STRICT;"; +CREATE TABLE IF NOT EXISTS datasets ( + name TEXT UNIQUE NOT NULL, + last_sync INTEGER NOT NULL, + game_id INTEGER NOT NULL, + game_name TEXT NOT NULL, + country TEXT, + state TEXT, + decay_rate REAL NOT NULL, + period REAL NOT NULL, + tau REAL NOT NULL +) STRICT;"; let connection = sqlite::open(":memory:")?; connection.execute(query)?;