polar: allow properly specifying polar_dir, with ~ as a default
This commit is contained in:
parent
8f86d7706b
commit
f3d5064ff2
4 changed files with 55 additions and 12 deletions
|
@ -7,18 +7,21 @@ import pytest # type: ignore
|
|||
|
||||
# todo maybe search fot info.json recursively?
|
||||
@pytest.mark.parametrize('dotpolar', [
|
||||
'',
|
||||
'data/polar/BojanKV_polar/.polar',
|
||||
'data/polar/TheCedarPrince_KnowledgeRepository',
|
||||
'data/polar/coelias_polardocs',
|
||||
'data/polar/warkdarrior_polar-document-repository'
|
||||
])
|
||||
def test_hpi(dotpolar: str):
|
||||
pdir = Path(ROOT / dotpolar)
|
||||
class user_config:
|
||||
export_dir = pdir
|
||||
if dotpolar != '':
|
||||
pdir = Path(ROOT / dotpolar)
|
||||
class user_config:
|
||||
export_dir = pdir
|
||||
|
||||
import my.config
|
||||
setattr(my.config, 'polar', user_config)
|
||||
|
||||
import my.config
|
||||
setattr(my.config, 'polar', user_config)
|
||||
import sys
|
||||
M = 'my.reading.polar'
|
||||
if M in sys.modules:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue