config: Add Config.payment_threshold() method.
This just returns a constant for now, but we know it may need to be configurable in the future. Other code can start using this now to be configurable in the future.
This commit is contained in:
parent
93feb2f4a3
commit
5f85d9c747
2 changed files with 10 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import decimal
|
||||
import functools
|
||||
import os
|
||||
import urllib.parse as urlparse
|
||||
|
@ -86,6 +87,9 @@ class Config:
|
|||
and self._dir_or_none(cache_root / name)
|
||||
)
|
||||
|
||||
def payment_threshold(self) -> decimal.Decimal:
|
||||
return decimal.Decimal(0)
|
||||
|
||||
def repository_path(self) -> Optional[Path]:
|
||||
try:
|
||||
return Path(os.environ['CONSERVANCY_REPOSITORY'])
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import contextlib
|
||||
import decimal
|
||||
import os
|
||||
import re
|
||||
|
||||
|
@ -281,3 +282,8 @@ def test_cache_path_parent_conflict(tmp_path):
|
|||
with update_environ(HOME=tmp_path, XDG_CACHE_DIR=None):
|
||||
config = config_mod.Config()
|
||||
assert config.cache_dir_path('TESTcache') is None
|
||||
|
||||
def test_payment_threshold():
|
||||
threshold = config_mod.Config().payment_threshold()
|
||||
assert threshold == 0
|
||||
assert isinstance(threshold, (int, decimal.Decimal))
|
||||
|
|
Loading…
Reference in a new issue