From: Jiri Vlasak Date: Mon, 25 Mar 2019 12:35:13 +0000 (+0100) Subject: Update test db with 3rd tester X-Git-Tag: v0.2.0~3^2~5 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/hubacji1/coffee-getter.git/commitdiff_plain/d350e7ffff9216c96d6d65be4066eb187385ed62 Update test db with 3rd tester --- diff --git a/ut/test_db.py b/ut/test_db.py index 6ea6952..0aae05d 100644 --- a/ut/test_db.py +++ b/ut/test_db.py @@ -53,6 +53,7 @@ insert or ignore into days values cur.executescript(""" INSERT INTO users VALUES('1111','tester'); INSERT INTO users VALUES('2222','newer'); +INSERT INTO users VALUES('3333','clone'); INSERT INTO coffees (id, flavor, time) VALUES ('1111', 'espresso lungo', datetime('now', 'localtime', '-99 seconds')), ('1111', 'Club-Mate 0,5 l', datetime('now', 'localtime', '-99 seconds')), @@ -69,7 +70,11 @@ INSERT INTO coffees (id, flavor, time) VALUES ('2222', 'espresso lungo', datetime('now', 'localtime', '-99 seconds')), ('2222', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-99 seconds')), ('2222', 'espresso lungo', datetime('now', 'localtime', '-95 second')), -('2222', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-95 second')); +('2222', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-95 second')), +('3333', 'espresso lungo', datetime('now', 'localtime', '-99 seconds')), +('3333', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-99 seconds')), +('3333', 'espresso lungo', datetime('now', 'localtime', '-95 second')), +('3333', 'Club-Mate 0,33 l', datetime('now', 'localtime', '-95 second')); """) con.close() @@ -107,7 +112,8 @@ class TopMateDrinkers(TestCase): top, [ ("tester", 4*0.5 + 4*0.33), - ("newer", 2*0.33) + ("newer", 2*0.33), + ("clone", 2*0.33), ] ) finally: @@ -119,7 +125,7 @@ class TopMateDrinkers(TestCase): db = Db(TESTDB_FILENAME) top = db.getTopMateDrinkers() self.assertIsNotNone(top) - self.assertEqual(len(top), 2) + self.assertEqual(len(top), 3) finally: delete_test_db(TESTDB_FILENAME)