Skip to content

Commit

Permalink
tests: Add checks for get_GEO cache arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfreimuth committed Mar 24, 2024
1 parent 912a4ae commit 8bdac0c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_GEOparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
Tests for `GEOparse` module.
"""

import tempfile
import unittest
import os
from os.path import abspath, dirname, isdir, isfile, join
from sys import path

Expand Down Expand Up @@ -550,6 +552,11 @@ def test_get_geo_and_data(self):
self.assertEqual(len(subset.metadata.keys()), 4)
self.assertTrue(isinstance(subset, GDSSubset))

def test_get_geo_no_cache(self):
with tempfile.TemporaryDirectory(suffix="geoparse_test") as temp_dir:
GEO.get_GEO(geo="GDS507", destdir=temp_dir, cache=False)
self.assertTrue(len(os.listdir(temp_dir)) == 0)


class TestGSE(unittest.TestCase):
"""Test GSE class"""
Expand Down Expand Up @@ -708,6 +715,11 @@ def test_download_SRA(self):
self.assertEqual(len(gpl.table.index), 12625)
self.assertTrue(isinstance(gpl, GPL))

def test_get_geo_no_cache(self):
with tempfile.TemporaryDirectory(suffix="geoparse_test") as temp_dir:
GEO.get_GEO(geo="GSE1563", destdir=temp_dir, cache=False)
self.assertTrue(len(os.listdir(temp_dir)) == 0)


if __name__ == "__main__":
unittest.main()

0 comments on commit 8bdac0c

Please sign in to comment.