Changeset - 5f85d9c74776
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-03-29 14:21:37
brettcsmith@brettcsmith.org
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.
2 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/config.py
Show inline comments
...
 
@@ -16,2 +16,3 @@
 

	
 
import decimal
 
import functools
...
 
@@ -88,2 +89,5 @@ class Config:
 

	
 
    def payment_threshold(self) -> decimal.Decimal:
 
        return decimal.Decimal(0)
 

	
 
    def repository_path(self) -> Optional[Path]:
tests/test_config.py
Show inline comments
...
 
@@ -17,2 +17,3 @@
 
import contextlib
 
import decimal
 
import os
...
 
@@ -283 +284,6 @@ def test_cache_path_parent_conflict(tmp_path):
 
        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))
0 comments (0 inline, 0 general)