-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expire SRA and GEO metadata after 14 days
- Loading branch information
Showing
4 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
from rnaseq_pipeline.targets import GemmaDatasetPlatform, GemmaDatasetHasBatch | ||
import tempfile | ||
|
||
from datetime import timedelta | ||
from time import sleep | ||
from rnaseq_pipeline.targets import GemmaDatasetPlatform, GemmaDatasetHasBatch, ExpirableLocalTarget | ||
|
||
def test_gemma_targets(): | ||
assert GemmaDatasetHasBatch('GSE110256').exists() | ||
assert GemmaDatasetPlatform('GSE110256', 'Generic_mouse_ncbiIds').exists() | ||
|
||
def test_expirable_local_target(): | ||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
t = ExpirableLocalTarget(tmp_dir + '/test', ttl=timedelta(seconds=1)) | ||
assert not t.exists() | ||
with t.open('w') as f: | ||
pass | ||
assert t.exists() | ||
sleep(1) | ||
assert not t.exists() | ||
|
||
def test_expirable_local_target_with_float_ttl(): | ||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
t = ExpirableLocalTarget(tmp_dir + '/test', ttl=1.0) | ||
assert not t.exists() | ||
with t.open('w') as f: | ||
pass | ||
assert t.exists() | ||
sleep(1) | ||
assert not t.exists() |