"""
Unit tests for the portion of this project which provides utilities to be used
by other parts of this project.
"""

@@ -108,12 +108,1380 @@
 roject.%0A%22%22%22%0A
+%0Aimport sys%0Aimport unittest%0A%0Afrom os import path%0A%0A# PATH MAGIC%0A# Project root%0Abase = path.abspath(path.join(path.dirname(path.abspath(__file__)), %22../..%22))%0Asys.path.insert(0, base)%0A%0Afrom SocialNPHS.utils.database import Database%0A%0A%0A# Path to JSON file%0Adbpath = path.join(base, %22tests/tests/testassets/testdb.json%22)%0A%0A%0Aclass testTwitter(unittest.TestCase):%0A    def test_basic_usage(self):%0A        db = Database(dbpath)%0A        old = db%5B%22cats%22%5D  # Store old value%0A%0A        # Change value%0A        msg = %22database corruption wreaks havoc upon this earth%22%0A        db%5B%22cats%22%5D = msg%0A        # Test that the file was changed by making a new instance and reading%0A        stored = Database(dbpath)%5B%22cats%22%5D%0A        self.assertEqual(stored, msg)%0A        # Restore%0A        db%5B%22cats%22%5D = old%0A%0A    def test_fancy_stuff(self):%0A        %22%22%22 Test adding and deleting an item from the database, as well as%0A        db.get and the semantic %22in%22 %22%22%22%0A%0A        db = Database(dbpath)%0A        db%5B%22penguins%22%5D = %22woah it's a penguin%22%0A        self.assertEqual(Database(dbpath)%5B%22penguins%22%5D, %22woah it's a penguin%22)%0A        self.assertIn(%22penguins%22, Database(dbpath))     # test semantic in%0A        db.pop(%22penguins%22)                              # test pop%0A        self.assertEqual(Database(dbpath).get(%22penguins%22, %22nope%22), %22nope%22)%0A        self.assertNotIn(%22penguins%22, Database(dbpath))  # test reverse%0A

Add tests for utils