-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Code Coverage]
test_home.py
(#6638)
Adding test for `torch_geometric/home.py` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
- Loading branch information
1 parent
a8b342f
commit 9e2c604
Showing
5 changed files
with
57 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import os.path as osp | ||
|
||
from torch_geometric import get_home_dir, set_home_dir | ||
from torch_geometric.home import DEFAULT_CACHE_DIR | ||
|
||
|
||
def test_home(): | ||
os.environ.pop('PYG_HOME', None) | ||
home_dir = osp.expanduser(DEFAULT_CACHE_DIR) | ||
assert get_home_dir() == home_dir | ||
|
||
home_dir = '/tmp/test_pyg1' | ||
os.environ['PYG_HOME'] = home_dir | ||
assert get_home_dir() == home_dir | ||
|
||
home_dir = '/tmp/test_pyg2' | ||
set_home_dir(home_dir) | ||
assert get_home_dir() == home_dir |
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