mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Implement version-checking test
- Add new step definition Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
3055cca767
commit
7657bd7221
2 changed files with 28 additions and 0 deletions
|
@ -5,6 +5,7 @@ import shutil
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import toml
|
||||||
|
|
||||||
from pytest import fixture
|
from pytest import fixture
|
||||||
from pytest_bdd import given
|
from pytest_bdd import given
|
||||||
|
@ -30,6 +31,11 @@ def temp_dir():
|
||||||
def working_dir(request):
|
def working_dir(request):
|
||||||
return os.path.join(request.config.rootpath, "tests")
|
return os.path.join(request.config.rootpath, "tests")
|
||||||
|
|
||||||
|
@fixture
|
||||||
|
def toml_version(working_dir):
|
||||||
|
pyproject = os.path.join(working_dir, "..", "pyproject.toml")
|
||||||
|
pyproject_contents = toml.load(pyproject)
|
||||||
|
return pyproject_contents["tool"]["poetry"]["version"]
|
||||||
|
|
||||||
# ----- STEPS ----- #
|
# ----- STEPS ----- #
|
||||||
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
|
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
|
||||||
|
@ -98,3 +104,9 @@ def matches_std_output(regex, cli_run):
|
||||||
def check_output_inline(text, cli_run):
|
def check_output_inline(text, cli_run):
|
||||||
assert text and text in cli_run['stdout']
|
assert text and text in cli_run['stdout']
|
||||||
|
|
||||||
|
|
||||||
|
@then("the output should contain pyproject.toml version")
|
||||||
|
def check_output_version_inline(cli_run, toml_version):
|
||||||
|
out = cli_run['stdout']
|
||||||
|
assert toml_version in out, toml_version
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
from pytest_bdd import scenarios
|
from pytest_bdd import scenarios
|
||||||
|
|
||||||
|
scenarios("../features/build.feature")
|
||||||
scenarios("../features/core.feature")
|
scenarios("../features/core.feature")
|
||||||
|
# scenarios("../features/datetime.feature")
|
||||||
|
# scenarios("../features/delete.feature")
|
||||||
|
# scenarios("../features/encrypt.feature")
|
||||||
|
# scenarios("../features/file_storage.feature")
|
||||||
|
# scenarios("../features/format.feature")
|
||||||
|
# scenarios("../features/import.feature")
|
||||||
|
# scenarios("../features/multiple_journals.feature")
|
||||||
|
# scenarios("../features/password.feature")
|
||||||
|
# scenarios("../features/search.feature")
|
||||||
|
# scenarios("../features/star.feature")
|
||||||
|
# scenarios("../features/tag.feature")
|
||||||
|
# scenarios("../features/upgrade.feature")
|
||||||
|
# scenarios("../features/write.feature")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue