mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Tests for encryption
This commit is contained in:
parent
a84713e99a
commit
c0733f36c5
5 changed files with 56 additions and 0 deletions
|
@ -79,6 +79,20 @@ def journal_doesnt_exist(context, journal_name="default"):
|
|||
journal_path = config['journals'][journal_name]
|
||||
assert not os.path.exists(journal_path)
|
||||
|
||||
@then('the config should have "{key}" set to "{value}"')
|
||||
def config_var(context, key, value):
|
||||
t, value = value.split(":")
|
||||
value = {
|
||||
"bool": lambda v: v.lower() == "true",
|
||||
"int": int,
|
||||
"str": str
|
||||
}[t](value)
|
||||
with open(jrnl.CONFIG_PATH) as config_file:
|
||||
config = json.load(config_file)
|
||||
assert key in config
|
||||
print key, config[key], type(config[key]), value, type(value)
|
||||
assert config[key] == value
|
||||
|
||||
@then('the journal should have {number:d} entries')
|
||||
@then('the journal should have {number:d} entry')
|
||||
@then('journal "{journal_name}" should have {number:d} entries')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue