mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Add bdd tests for jrnl installation (#1513)
* Added bdd tests for jrnl installation
This commit is contained in:
parent
23bc0f2c8f
commit
8b955ef002
6 changed files with 95 additions and 1 deletions
|
@ -97,6 +97,12 @@ def output_should_contain_version(cli_run, toml_version):
|
|||
assert toml_version in out, toml_version
|
||||
|
||||
|
||||
@then("the version in the config file should be up-to-date")
|
||||
def config_file_version(config_on_disk, toml_version):
|
||||
config_version = config_on_disk["version"]
|
||||
assert config_version == toml_version
|
||||
|
||||
|
||||
@then(parse("the output should be {width:d} columns wide"))
|
||||
def output_should_be_columns_wide(cli_run, width):
|
||||
out = cli_run["stdout"]
|
||||
|
@ -105,6 +111,22 @@ def output_should_be_columns_wide(cli_run, width):
|
|||
assert len(line) <= width
|
||||
|
||||
|
||||
@then(
|
||||
parse(
|
||||
'the default journal "{journal_file}" should be in the "{journal_dir}" directory'
|
||||
)
|
||||
)
|
||||
def default_journal_location(journal_file, journal_dir, config_on_disk, temp_dir):
|
||||
default_journal_path = config_on_disk["journals"]["default"]
|
||||
expected_journal_path = (
|
||||
os.path.join(temp_dir.name, journal_file)
|
||||
if journal_dir == "."
|
||||
else os.path.join(temp_dir.name, journal_dir, journal_file)
|
||||
)
|
||||
# Use os.path.samefile here because both paths might not be fully expanded.
|
||||
assert os.path.samefile(default_journal_path, expected_journal_path)
|
||||
|
||||
|
||||
@then(
|
||||
parse(
|
||||
'the config for journal "{journal_name}" {should_or_should_not} contain "{some_yaml}"'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue