diff --git a/.gitignore b/.gitignore index 34a6b66..15c9ea8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *egg-info __pycache__ *cookies.txt +.tox/ diff --git a/humblebundle_downloader/download_library.py b/humblebundle_downloader/download_library.py index a2aa21d..33dee61 100644 --- a/humblebundle_downloader/download_library.py +++ b/humblebundle_downloader/download_library.py @@ -37,7 +37,6 @@ class DownloadLibrary: platform_include = [] self.platform_include = list(map(str.lower, platform_include)) - self.cache_file = os.path.join(library_path, '.cache.json') self.purchase_keys = purchase_keys self.trove = trove self.update = update @@ -59,6 +58,7 @@ class DownloadLibrary: def start(self): + self.cache_file = os.path.join(self.library_path, '.cache.json') self.cache_data = self._load_cache_data(self.cache_file) self.purchase_keys = self.purchase_keys if self.purchase_keys else self._get_purchase_keys() # noqa: E501 diff --git a/tests/test_download_library.py b/tests/test_download_library.py index a2ad0cc..f3d473d 100644 --- a/tests/test_download_library.py +++ b/tests/test_download_library.py @@ -6,7 +6,6 @@ from humblebundle_downloader.download_library import DownloadLibrary ### def test_include_logic_has_values(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', ext_include=['pdf', 'EPub'], ) @@ -18,7 +17,6 @@ def test_include_logic_has_values(): def test_include_logic_empty(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', ext_include=[], ) @@ -30,7 +28,6 @@ def test_include_logic_empty(): def test_exclude_logic_has_values(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', ext_exclude=['pdf', 'EPub'], ) @@ -42,7 +39,6 @@ def test_exclude_logic_has_values(): def test_exclude_logic_empty(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', ext_exclude=[], ) @@ -57,7 +53,6 @@ def test_exclude_logic_empty(): ### def test_download_platform_filter_none(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', platform_include=None, ) @@ -67,7 +62,6 @@ def test_download_platform_filter_none(): def test_download_platform_filter_blank(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', platform_include=[], ) @@ -77,7 +71,6 @@ def test_download_platform_filter_blank(): def test_download_platform_filter_audio(): dl = DownloadLibrary( - 'fake_cookie_path', 'fake_library_path', platform_include=['audio'], ) diff --git a/tox.ini b/tox.ini index 5eb97ad..f9ce213 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,10 @@ [tox] -envlist = flake8 +envlist = flake8, py36 +[testenv] +deps = + pytest +commands = pytest [testenv:flake8] basepython = python3