2023-05-25 21:55:20 +00:00
|
|
|
'''
|
|
|
|
`piker.accounting` mgmt calculations for
|
|
|
|
- positioning
|
|
|
|
- ledger updates
|
|
|
|
- config file IO
|
|
|
|
|
|
|
|
'''
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
from piker import config
|
2023-06-28 18:17:56 +00:00
|
|
|
from piker.accounting import load_account
|
2023-05-25 21:55:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_root_conf_networking_section(
|
|
|
|
root_conf: dict,
|
|
|
|
):
|
|
|
|
conf, path = config.load(
|
|
|
|
'conf',
|
|
|
|
touch_if_dne=True,
|
|
|
|
)
|
|
|
|
assert conf['network']['tsdb']
|
|
|
|
|
|
|
|
|
|
|
|
def test_account_file_default_empty(
|
|
|
|
tmpconfdir: Path,
|
|
|
|
):
|
2023-06-28 18:17:56 +00:00
|
|
|
conf, path = load_account(
|
2023-05-25 21:55:20 +00:00
|
|
|
'kraken',
|
|
|
|
'paper',
|
|
|
|
)
|
|
|
|
|
|
|
|
# ensure the account file empty but created
|
|
|
|
# and in the correct place in the filesystem!
|
|
|
|
assert not conf
|
|
|
|
assert path.parent.is_dir()
|
|
|
|
assert path.parent.name == 'accounting'
|