diff --git a/pysus/ftp/__init__.py b/pysus/ftp/__init__.py index e0ec558..134960b 100644 --- a/pysus/ftp/__init__.py +++ b/pysus/ftp/__init__.py @@ -16,6 +16,9 @@ "PYSUS_CACHEPATH", os.path.join(str(pathlib.Path.home()), "pysus") ) +__cachepath__ = pathlib.Path(CACHEPATH) +__cachepath__.mkdir(exist_ok=True) + def to_list(ite: Any) -> list: """Parse any builtin data type into a list""" diff --git a/pysus/tests/test_ftp/test_File.py b/pysus/tests/test_ftp/test_File.py index e69de29..5752e41 100644 --- a/pysus/tests/test_ftp/test_File.py +++ b/pysus/tests/test_ftp/test_File.py @@ -0,0 +1,10 @@ +# -*- coding:utf-8 -*- +u""" +Created on 2023/12/12 +by luabida +license: GPL V3 or Later +""" +import unittest +import datetime + +from pysus.ftp import File diff --git a/pysus/tests/test_ftp/test_databases/test_CIHA.py b/pysus/tests/test_ftp/test_databases/test_CIHA.py index fc2c865..a47e6bd 100644 --- a/pysus/tests/test_ftp/test_databases/test_CIHA.py +++ b/pysus/tests/test_ftp/test_databases/test_CIHA.py @@ -50,7 +50,7 @@ def test_ciha(self): 'pysus.ftp.databases.ciha.CIHA', return_value=MagicMock(__content__=mock_content) ) as mock_ciha: - ciha = CIHA() + ciha = CIHA().load() ciha.__content__ = mock_ciha().__content__ descriptions = [ciha.describe(file) for file in ciha.files] diff --git a/pysus/tests/test_ftp/test_databases/test_PNI.py b/pysus/tests/test_ftp/test_databases/test_PNI.py index 9b482d6..dc6fc58 100644 --- a/pysus/tests/test_ftp/test_databases/test_PNI.py +++ b/pysus/tests/test_ftp/test_databases/test_PNI.py @@ -35,9 +35,9 @@ def test_pni(self): 'modify': datetime.datetime(2019, 5, 23, 16, 39) } ), - "STAC0510.dbc": File( + "CPNIAC02.DBF": File( path="/dissemin/publicos/PNI/DADOS/CPNIAC02.DBF", - name="STAC0510.dbc", + name="CPNIAC02.DBF", info={ 'size': 14843, 'type': 'file',