Unskip some tests (#1399)

* remove skip_editor test and tag

* remove useless test

* unskip blank input test

* formatting

* rename test so it doesn't overwrite other test

* unskip some dayone tests that now work
This commit is contained in:
Jonathan Wren 2022-01-15 14:45:00 -08:00 committed by GitHub
parent 49930e16f7
commit 1fbb788528
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 63 deletions

View file

@ -144,12 +144,11 @@ Feature: Custom formats
| basic_folder.yaml | | basic_folder.yaml |
| basic_dayone.yaml | | basic_dayone.yaml |
@skip_editor # .TODO return after editor steps implemented
Scenario Outline: Increasing Headings on Markdown export Scenario Outline: Increasing Headings on Markdown export
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
When we open the editor and append Given we append to the editor if opened
[2020-10-14 13:23] Heading Test [2021-10-14 13:23] Heading Test
H1-1 H1-1
= =
@ -191,13 +190,15 @@ Feature: Custom formats
More stuff More stuff
more stuff again more stuff again
When we run "jrnl --edit -1"
Then the editor should have been called
When we run "jrnl -1 --export markdown" When we run "jrnl -1 --export markdown"
Then the output should be Then the output should be
# 2020 # 2021
## October ## October
### 2020-10-14 13:23 Heading Test ### 2021-10-14 13:23 Heading Test
#### H1-1 #### H1-1
@ -241,38 +242,6 @@ Feature: Custom formats
| basic_folder.yaml | | basic_folder.yaml |
# | basic_dayone.yaml | @todo # | basic_dayone.yaml | @todo
@skip_editor # .TODO return after editor steps implemented
Scenario Outline: Add a blank line to Markdown export if there isn't one already
# https://github.com/jrnl-org/jrnl/issues/768
# https://github.com/jrnl-org/jrnl/issues/881
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we open the editor and append
[2020-10-29 11:11] First entry.
[2020-10-29 11:11] Second entry.
[2020-10-29 11:13] Third entry.
When we run "jrnl -3 --format markdown"
Then the output should be
# 2020
## October
### 2020-10-29 11:11 First entry.
### 2020-10-29 11:11 Second entry.
### 2020-10-29 11:13 Third entry.
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
# | basic_dayone.yaml | @todo
@skip @skip
Scenario Outline: Exporting to XML Scenario Outline: Exporting to XML
Given we use the config "<config_file>" Given we use the config "<config_file>"
@ -289,12 +258,12 @@ Feature: Custom formats
Examples: configs Examples: configs
| config_file | | config_file |
# | basic_onefile.yaml | @todo | basic_onefile.yaml |
# | basic_encrypted.yaml | @todo | basic_encrypted.yaml |
# | basic_folder.yaml | @todo | basic_folder.yaml |
# | basic_dayone.yaml | @todo | basic_dayone.yaml |
Scenario: Exporting to XML Scenario: Exporting to XML single
Given we use the config "tags.yaml" Given we use the config "tags.yaml"
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --export xml" When we run "jrnl --export xml"

View file

@ -89,21 +89,22 @@ Feature: Writing new entries.
| basic_encrypted.yaml | | basic_encrypted.yaml |
| basic_onefile.yaml | | basic_onefile.yaml |
@skip
Scenario Outline: Writing an empty entry from the command line with no editor should yield nothing Scenario Outline: Writing an empty entry from the command line with no editor should yield nothing
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "bad doggie no biscuit" if prompted And we use the password "test" if prompted
When we run "jrnl" and enter nothing When we run "jrnl --config-override editor ''" and enter ""
Then the output should be empty Then the stdin prompt should have been called
And the output should be empty
And the error output should contain "Writing Entry; on a blank line" And the error output should contain "Writing Entry; on a blank line"
And the editor should not have been called And the editor should not have been called
Examples: configs Examples: configs
| config_file | | config_file |
| config_simple.yaml | | basic_onefile.yaml |
| empty_folder.yaml | | basic_encrypted.yaml |
| encrypted.yaml | | basic_folder.yaml |
# | dayone | @todo | basic_dayone.yaml |
Scenario Outline: Writing an entry does not print the entire journal Scenario Outline: Writing an entry does not print the entire journal
# https://github.com/jrnl-org/jrnl/issues/87 # https://github.com/jrnl-org/jrnl/issues/87
@ -212,7 +213,7 @@ Feature: Writing new entries.
When we run "jrnl -1" When we run "jrnl -1"
Then the output should be "2013-07-23 09:00 Testing folder journal." Then the output should be "2013-07-23 09:00 Testing folder journal."
Scenario Outline: Correctly count when adding a single entry via --edit Scenario Outline: Count when adding a single entry via --edit
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
@ -282,7 +283,7 @@ Feature: Writing new entries.
#| basic_dayone.yaml | @todo #| basic_dayone.yaml | @todo
Scenario Outline: Correctly count modification when running --edit on whole journal and adding to last entry Scenario Outline: Count modifications when editing whole journal and adding to last entry
Given we use the config "<config_file>" Given we use the config "<config_file>"
And we use the password "test" if prompted And we use the password "test" if prompted
And we append to the editor if opened And we append to the editor if opened
@ -296,4 +297,4 @@ Feature: Writing new entries.
| basic_onefile.yaml | | basic_onefile.yaml |
| basic_encrypted.yaml | | basic_encrypted.yaml |
| basic_folder.yaml | | basic_folder.yaml |
#| basic_dayone.yaml | @todo | basic_dayone.yaml |

View file

@ -17,10 +17,6 @@ pytest_plugins = [
def pytest_bdd_apply_tag(tag, function): def pytest_bdd_apply_tag(tag, function):
if tag == "skip_win": if tag == "skip_win":
marker = mark.skipif(on_windows(), reason="Skip test on Windows") marker = mark.skipif(on_windows(), reason="Skip test on Windows")
elif tag == "skip_editor":
marker = mark.skip(
reason="Skipping editor-related test. We should come back to this!"
)
else: else:
# Fall back to pytest-bdd's default behavior # Fall back to pytest-bdd's default behavior
return None return None

View file

@ -20,14 +20,13 @@ def when_we_change_directory(directory_name):
# These variables are used in the `@when(re(...))` section below # These variables are used in the `@when(re(...))` section below
command = '(?P<command>[^"]+)' command = '(?P<command>[^"]*)'
input_method = "(?P<input_method>enter|pipe)" input_method = "(?P<input_method>enter|pipe)"
user_input = '(?P<user_input>[^"]+)' user_input = '("(?P<user_input>[^"]*)")'
@when(parse('we run "jrnl {command}" and {input_method}\n{user_input}')) @when(parse('we run "jrnl {command}" and {input_method}\n{user_input}'))
@when(re(f'we run "jrnl {command}" and {input_method} "{user_input}"')) @when(re(f'we run "jrnl ?{command}" and {input_method} {user_input}'))
@when(re(f'we run "jrnl" and {input_method} "{user_input}"'))
@when(parse('we run "jrnl {command}"')) @when(parse('we run "jrnl {command}"'))
@when('we run "jrnl"') @when('we run "jrnl"')
def we_run_jrnl(cli_run, capsys, keyring): def we_run_jrnl(cli_run, capsys, keyring):