Skip to content
Snippets Groups Projects
Commit f898e5ef authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

STY: ws changes

parent 0f2533f4
Branches
Tags
2 merge requests!59FIX: if multiple updates for one entity exist, the retrieve would result in an...,!46F cache version
...@@ -94,6 +94,7 @@ class CacheTest(unittest.TestCase): ...@@ -94,6 +94,7 @@ class CacheTest(unittest.TestCase):
self.assertEqual(self.cache.check_existing(hashes[0])[0], 1001) self.assertEqual(self.cache.check_existing(hashes[0])[0], 1001)
self.assertEqual(self.cache.check_existing(hashes[2])[0], 1003) self.assertEqual(self.cache.check_existing(hashes[2])[0], 1003)
def create_sqlite_file(commands): def create_sqlite_file(commands):
""" """
A temporary file will be used A temporary file will be used
...@@ -109,6 +110,7 @@ def create_sqlite_file(commands): ...@@ -109,6 +110,7 @@ def create_sqlite_file(commands):
conn.close() conn.close()
return db_file return db_file
class CacheTest2(unittest.TestCase): class CacheTest2(unittest.TestCase):
""" """
Test the schema version. Test the schema version.
...@@ -145,8 +147,6 @@ class CacheTest2(unittest.TestCase): ...@@ -145,8 +147,6 @@ class CacheTest2(unittest.TestCase):
("INSERT INTO version VALUES (?)", (1,)), ("INSERT INTO version VALUES (?)", (1,)),
("INSERT INTO version VALUES (?)", (3,))])]) ("INSERT INTO version VALUES (?)", (3,))])])
def test_schema(self): def test_schema(self):
# Test whether new cache is created correctly: # Test whether new cache is created correctly:
assert os.path.exists(self.cache.db_file) assert os.path.exists(self.cache.db_file)
...@@ -175,6 +175,7 @@ class CacheTest2(unittest.TestCase): ...@@ -175,6 +175,7 @@ class CacheTest2(unittest.TestCase):
for db_fn_defect in self.db_file_defect: for db_fn_defect in self.db_file_defect:
os.remove(db_fn_defect) os.remove(db_fn_defect)
class InvalidationTest(unittest.TestCase): class InvalidationTest(unittest.TestCase):
""" """
Test invalidation of cache entries. Test invalidation of cache entries.
...@@ -188,7 +189,6 @@ class InvalidationTest(unittest.TestCase): ...@@ -188,7 +189,6 @@ class InvalidationTest(unittest.TestCase):
def tearDown(self): def tearDown(self):
os.remove(self.cache.db_file) os.remove(self.cache.db_file)
def test_invalid(self): def test_invalid(self):
ent = db.Record() ent = db.Record()
ent2 = db.Record() ent2 = db.Record()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment