Example #1
0
 def test_query_multiple_items_by_name(self):
     self.assertTrue(db.insert_user_table(blueberries))
     self.assertTrue(db.insert_user_table(wild_blueberries))
     self.assertTrue(db.insert_user_table(blue_lollipops))
     result = db.query_user_item_by_name('blue')
     self.assertIsNotNone(result)
     self.assertEqual(len(result), 3)
Example #2
0
 def test_query_by_id(self):
     self.assertTrue(db.insert_user_table(strawberries))
     self.assertTrue(db.insert_user_table(blueberries))
     self.assertTrue(db.insert_user_table(blackberries))
     result = db.query_user_item_by_id(blueberries[1])
     self.assertIsNotNone(result)
     self.assertEqual(len(result), 1)
     self.assertEqual(result[0][1], blueberries[1])
Example #3
0
 def test_delete_all(self):
     self.assertTrue(db.insert_user_table(blueberries))
     self.assertTrue(db.insert_user_table(strawberries))
     self.assertTrue(db.insert_user_table(blackberries))
     self.assertTrue(db.delete_all_user_items())
Example #4
0
 def test_add_unique_item_and_remove(self):
     self.assertTrue(db.insert_user_table(blueberries))
     self.assertTrue(db.delete_user_item(blueberries[1]))