-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7391c66
commit eb452ee
Showing
3 changed files
with
40 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import unittest | ||
from os import path | ||
import pandas as pd | ||
import pickle | ||
|
||
from thunderbolt import Thunderbolt | ||
from thunderbolt.client.local_cache import LocalCache | ||
""" | ||
requires: | ||
python sample.py test.TestCaseTask --param=sample --number=1 --workspace-directory=./test_case --local-scheduler | ||
""" | ||
|
||
|
||
class LocalCacheTest(unittest.TestCase): | ||
def test_running(self): | ||
target = Thunderbolt(self._get_test_case_path(), use_cache=False) | ||
_ = Thunderbolt(self._get_test_case_path()) | ||
output = Thunderbolt(self._get_test_case_path()) | ||
|
||
for k, v in target.tasks.items(): | ||
if k == 'last_modified': # cache file | ||
continue | ||
self.assertEqual(v, output.tasks[k]) | ||
|
||
output.client.local_cache.clear() | ||
|
||
def _get_test_case_path(self, file_name: str = ''): | ||
p = path.abspath(path.join(path.dirname(__file__), 'test_case')) | ||
if file_name: | ||
return path.join(p, file_name) | ||
return p |
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