-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pooch cache manager verbosity control
- Loading branch information
Showing
4 changed files
with
69 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
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 @@ | ||
"""Unit-tests for :mod:`geovista.cache`.""" |
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,32 @@ | ||
"""Unit-tests for :func:`geovista.cache.pooch_mute`.""" | ||
from __future__ import annotations | ||
|
||
from pooch import get_logger | ||
|
||
from geovista.cache import pooch_mute | ||
|
||
|
||
def test(): | ||
"""Test all behaviours as one atomic test.""" | ||
logger = get_logger() | ||
|
||
# default silent kwarg | ||
pooch_mute() | ||
assert logger.getEffectiveLevel() == 30 | ||
from geovista.cache import GEOVISTA_POOCH_MUTE | ||
|
||
assert GEOVISTA_POOCH_MUTE is True | ||
|
||
# explicit verbose | ||
pooch_mute(silent=False) | ||
assert logger.getEffectiveLevel() == 0 | ||
from geovista.cache import GEOVISTA_POOCH_MUTE | ||
|
||
assert GEOVISTA_POOCH_MUTE is False | ||
|
||
# explicit silence | ||
pooch_mute(silent=True) | ||
assert logger.getEffectiveLevel() == 30 | ||
from geovista.cache import GEOVISTA_POOCH_MUTE | ||
|
||
assert GEOVISTA_POOCH_MUTE is True |