Skip to content

Commit

Permalink
update assertion checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed May 5, 2024
1 parent a8fb4c8 commit b56a3a5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import shutil

from pybiocfilecache.BiocFileCache import BiocFileCache

Expand All @@ -12,7 +11,7 @@

def test_create_cache():
bfc = BiocFileCache(CACHE_DIR)
assert os.path.exists(CACHE_DIR == True)
assert os.path.exists(CACHE_DIR)

bfc.purge()

Expand All @@ -22,11 +21,11 @@ def test_add_get_operations():

bfc.add("test1", os.getcwd() + "/tests/data/test1.txt")
rec1 = bfc.get("test1")
assert rec1 != None
assert rec1 is not None

bfc.add("test2", os.getcwd() + "/tests/data/test2.txt")
rec2 = bfc.get("test2")
assert rec2 != None
assert rec2 is not None

frec1 = open(rec1.rpath, "r").read()
assert frec1 == "test1"
Expand All @@ -42,14 +41,14 @@ def test_remove_operations():

bfc.add("test1", os.getcwd() + "/tests/data/test1.txt")
rec1 = bfc.get("test1")
assert rec1 != None
assert rec1 is not None

bfc.add("test2", os.getcwd() + "/tests/data/test2.txt")
rec2 = bfc.get("test2")
assert rec2 != None
assert rec2 is not None

bfc.remove("test1")
rec1 = bfc.get("test1")
assert rec1 == None
assert rec1 is None

bfc.purge()

0 comments on commit b56a3a5

Please sign in to comment.