take out redundant pytest step

This commit is contained in:
Jonathan Wren 2021-11-27 14:29:33 -08:00
parent a6694f5273
commit af8355b499
11 changed files with 39 additions and 45 deletions

View file

@ -29,7 +29,7 @@ Feature: Multiple journals
Given the config "multiple.yaml" exists Given the config "multiple.yaml" exists
And we use the config "basic_onefile.yaml" And we use the config "basic_onefile.yaml"
When we run "jrnl --cf multiple.yaml work a long day in the office" When we run "jrnl --cf multiple.yaml work a long day in the office"
Then we should see the message "Entry added to work journal" Then the output should contain "Entry added to work journal"
Scenario: Write to specified journal with a timestamp using an alternate config Scenario: Write to specified journal with a timestamp using an alternate config
Given the config "multiple.yaml" exists Given the config "multiple.yaml" exists
@ -64,7 +64,7 @@ Feature: Multiple journals
Given the config "bug343.yaml" exists Given the config "bug343.yaml" exists
And we use the config "basic_onefile.yaml" And we use the config "basic_onefile.yaml"
When we run "jrnl --cf bug343.yaml a long day in the office" When we run "jrnl --cf bug343.yaml a long day in the office"
Then we should see the message "No default journal configured" Then the output should contain "No default journal configured"
Scenario: Don't crash if no file exists for a configured encrypted journal using an alternate config Scenario: Don't crash if no file exists for a configured encrypted journal using an alternate config
Given the config "multiple.yaml" exists Given the config "multiple.yaml" exists
@ -73,7 +73,7 @@ Feature: Multiple journals
these three eyes these three eyes
these three eyes these three eyes
n n
Then we should see the message "Encrypted journal 'new_encrypted' created" Then the output should contain "Encrypted journal 'new_encrypted' created"
Scenario: Don't overwrite main config when encrypting a journal in an alternate config Scenario: Don't overwrite main config when encrypting a journal in an alternate config
Given the config "basic_onefile.yaml" exists Given the config "basic_onefile.yaml" exists
@ -82,7 +82,7 @@ Feature: Multiple journals
these three eyes these three eyes
these three eyes these three eyes
n n
Then we should see the message "Journal encrypted to features/journals/basic_onefile.journal" Then the output should contain "Journal encrypted to features/journals/basic_onefile.journal"
And the config should contain "encrypt: false" And the config should contain "encrypt: false"

View file

@ -4,7 +4,7 @@ Feature: Reading and writing to journal with custom date formats
# https://github.com/jrnl-org/jrnl/issues/117 # https://github.com/jrnl-org/jrnl/issues/117
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl 2013-11-30 15:42: Project Started." When we run "jrnl 2013-11-30 15:42: Project Started."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -999" When we run "jrnl -999"
Then the output should contain "2013-11-30 15:42 Project Started." Then the output should contain "2013-11-30 15:42 Project Started."
@ -13,7 +13,7 @@ Feature: Reading and writing to journal with custom date formats
# https://github.com/jrnl-org/jrnl/issues/185 # https://github.com/jrnl-org/jrnl/issues/185
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
When we run "jrnl 26/06/2099: Planet? Earth. Year? 2099." When we run "jrnl 26/06/2099: Planet? Earth. Year? 2099."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -999" When we run "jrnl -999"
Then the output should contain "2099-06-26 09:00 Planet?" Then the output should contain "2099-06-26 09:00 Planet?"
@ -34,7 +34,7 @@ Feature: Reading and writing to journal with custom date formats
Scenario Outline: Writing an entry from command line with custom date Scenario Outline: Writing an entry from command line with custom date
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl <command>" When we run "jrnl <command>"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should contain "<expected_output>" Then the output should contain "<expected_output>"
@ -87,7 +87,7 @@ Feature: Reading and writing to journal with custom date formats
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
And now is "2019-03-12 01:30:32 PM" And now is "2019-03-12 01:30:32 PM"
When we run "jrnl <command>" When we run "jrnl <command>"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -1" When we run "jrnl -1"
Then the output should contain "<expected_output>" Then the output should contain "<expected_output>"
Then the output should contain the date "<date>" Then the output should contain the date "<date>"
@ -109,7 +109,7 @@ Feature: Reading and writing to journal with custom date formats
Given we use the config "simple.yaml" Given we use the config "simple.yaml"
And now is "2019-03-12 01:30:32 PM" And now is "2019-03-12 01:30:32 PM"
When we run "jrnl <command>" When we run "jrnl <command>"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -1" When we run "jrnl -1"
Then the output should contain "<expected_output>" Then the output should contain "<expected_output>"
Then the output should contain the date "<date>" Then the output should contain the date "<date>"

View file

@ -4,7 +4,7 @@ Feature: Encrypting and decrypting journals
Given we use the config "encrypted.yaml" Given we use the config "encrypted.yaml"
# And we use the password "bad doggie no biscuit" if prompted # And we use the password "bad doggie no biscuit" if prompted
When we run "jrnl --decrypt" and enter "bad doggie no biscuit" When we run "jrnl --decrypt" and enter "bad doggie no biscuit"
Then we should see the message "Journal decrypted" Then the output should contain "Journal decrypted"
And the config for journal "default" should contain "encrypt: false" And the config for journal "default" should contain "encrypt: false"
When we run "jrnl -99 --short" When we run "jrnl -99 --short"
Then the output should be Then the output should be
@ -36,7 +36,7 @@ Feature: Encrypting and decrypting journals
swordfish swordfish
n n
Then we should get no error Then we should get no error
And we should see the message "Journal encrypted" And the output should contain "Journal encrypted"
And the config for journal "default" should contain "encrypt: true" And the config for journal "default" should contain "encrypt: true"
When we run "jrnl -n 1" and enter "swordfish" When we run "jrnl -n 1" and enter "swordfish"
Then we should be prompted for a password Then we should be prompted for a password

View file

@ -3,7 +3,7 @@ Feature: Journals iteracting with the file system in a way that users can see
Scenario: Adding entries to a Folder journal should generate date files Scenario: Adding entries to a Folder journal should generate date files
Given we use the config "empty_folder.yaml" Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal." When we run "jrnl 23 July 2013: Testing folder journal."
Then we should see the message "Entry added" Then the output should contain "Entry added"
And the journal directory should contain And the journal directory should contain
2013/07/23.txt 2013/07/23.txt
@ -11,7 +11,7 @@ Feature: Journals iteracting with the file system in a way that users can see
Given we use the config "empty_folder.yaml" Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal." When we run "jrnl 23 July 2013: Testing folder journal."
And we run "jrnl 3/7/2014: Second entry of journal." And we run "jrnl 3/7/2014: Second entry of journal."
Then we should see the message "Entry added" Then the output should contain "Entry added"
And the journal directory should contain And the journal directory should contain
2013/07/23.txt 2013/07/23.txt

View file

@ -34,7 +34,7 @@ Feature: Multiple journals
Scenario: Tell user which journal was used Scenario: Tell user which journal was used
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
When we run "jrnl work a long day in the office" When we run "jrnl work a long day in the office"
Then we should see the message "Entry added to work journal" Then the output should contain "Entry added to work journal"
Scenario: Write to specified journal with a timestamp Scenario: Write to specified journal with a timestamp
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"

View file

@ -61,7 +61,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --config-override journals.default features/journals/simple.journal 20 Mar 2000: The rain in Spain comes from clouds" When we run "jrnl --config-override journals.default features/journals/simple.journal 20 Mar 2000: The rain in Spain comes from clouds"
Then we should get no error Then we should get no error
And we should see the message "Entry added" And the output should contain "Entry added"
When we run "jrnl -3 --config-override journals.default features/journals/simple.journal" When we run "jrnl -3 --config-override journals.default features/journals/simple.journal"
Then the output should be Then the output should be
2000-03-20 09:00 The rain in Spain comes from clouds 2000-03-20 09:00 The rain in Spain comes from clouds
@ -78,7 +78,7 @@ Feature: Implementing Runtime Overrides for Select Configuration Keys
And we use the password "test" if prompted And we use the password "test" if prompted
When we run "jrnl --config-override journals.temp features/journals/simple.journal temp Sep 06 1969: @say Ni" When we run "jrnl --config-override journals.temp features/journals/simple.journal temp Sep 06 1969: @say Ni"
Then we should get no error Then we should get no error
And we should see the message "Entry added" And the output should contain "Entry added"
When we run "jrnl --config-override journals.temp features/journals/simple.journal temp -3" When we run "jrnl --config-override journals.temp features/journals/simple.journal temp -3"
Then the output should be Then the output should be
1969-09-06 09:00 @say Ni 1969-09-06 09:00 @say Ni

View file

@ -55,7 +55,7 @@ Feature: Using the installed keyring
this password will not be saved in keyring this password will not be saved in keyring
this password will not be saved in keyring this password will not be saved in keyring
y y
Then we should see the message "Failed to retrieve keyring" Then the output should contain "Failed to retrieve keyring"
And we should get no error And we should get no error
And we should be prompted for a password And we should be prompted for a password
And the config for journal "default" should contain "encrypt: true" And the config for journal "default" should contain "encrypt: true"
@ -69,7 +69,7 @@ Feature: Using the installed keyring
Then the error output should contain "Failed to retrieve keyring" Then the error output should contain "Failed to retrieve keyring"
And we should get no error And we should get no error
And we should be prompted for a password And we should be prompted for a password
And we should see the message "Journal decrypted" And the output should contain "Journal decrypted"
And the config for journal "default" should contain "encrypt: false" And the config for journal "default" should contain "encrypt: false"
When we run "jrnl --short" When we run "jrnl --short"
Then we should not be prompted for a password Then we should not be prompted for a password
@ -96,7 +96,7 @@ Feature: Using the installed keyring
swordfish swordfish
sordfish sordfish
Then we should be prompted for a password Then we should be prompted for a password
And we should see the message "Passwords did not match" And the output should contain "Passwords did not match"
And the config for journal "default" should not contain "encrypt: true" And the config for journal "default" should not contain "encrypt: true"
When we run "jrnl --short" When we run "jrnl --short"
Then the output should be Then the output should be
@ -113,8 +113,8 @@ Feature: Using the installed keyring
swordfish swordfish
n n
Then we should be prompted for a password Then we should be prompted for a password
And we should see the message "Passwords did not match" And the output should contain "Passwords did not match"
And we should see the message "Journal encrypted" And the output should contain "Journal encrypted"
And the config for journal "default" should contain "encrypt: true" And the config for journal "default" should contain "encrypt: true"
When we run "jrnl -1" and enter "swordfish" When we run "jrnl -1" and enter "swordfish"
Then we should be prompted for a password Then we should be prompted for a password

View file

@ -3,7 +3,7 @@ Feature: Searching in a journal
Scenario Outline: Displaying entries using -on today should display entries created today Scenario Outline: Displaying entries using -on today should display entries created today
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl today: Adding an entry right now." When we run "jrnl today: Adding an entry right now."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -on today" When we run "jrnl -on today"
Then the output should contain "Adding an entry right now." Then the output should contain "Adding an entry right now."
But the output should not contain "Everything is alright" But the output should not contain "Everything is alright"
@ -18,11 +18,11 @@ Feature: Searching in a journal
Scenario Outline: Displaying entries using -from day should display correct entries Scenario Outline: Displaying entries using -from day should display correct entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl yesterday: This thing happened yesterday" When we run "jrnl yesterday: This thing happened yesterday"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl today at 11:59pm: Adding an entry right now." When we run "jrnl today at 11:59pm: Adding an entry right now."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl tomorrow: A future entry." When we run "jrnl tomorrow: A future entry."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -from today" When we run "jrnl -from today"
Then the output should contain "Adding an entry right now." Then the output should contain "Adding an entry right now."
And the output should contain "A future entry." And the output should contain "A future entry."
@ -37,11 +37,11 @@ Feature: Searching in a journal
Scenario Outline: Displaying entries using -from and -to day should display correct entries Scenario Outline: Displaying entries using -from and -to day should display correct entries
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl yesterday: This thing happened yesterday" When we run "jrnl yesterday: This thing happened yesterday"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl today at 11:59pm: Adding an entry right now." When we run "jrnl today at 11:59pm: Adding an entry right now."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl tomorrow: A future entry." When we run "jrnl tomorrow: A future entry."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -from yesterday -to today" When we run "jrnl -from yesterday -to today"
Then the output should contain "This thing happened yesterday" Then the output should contain "This thing happened yesterday"
And the output should contain "Adding an entry right now." And the output should contain "Adding an entry right now."
@ -118,9 +118,9 @@ Feature: Searching in a journal
Scenario: Out of order entries to a Folder journal should be listed in date order Scenario: Out of order entries to a Folder journal should be listed in date order
Given we use the config "empty_folder.yaml" Given we use the config "empty_folder.yaml"
When we run "jrnl 3/7/2014 4:37pm: Second entry of journal." When we run "jrnl 3/7/2014 4:37pm: Second entry of journal."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl 23 July 2013: Testing folder journal." When we run "jrnl 23 July 2013: Testing folder journal."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -2" When we run "jrnl -2"
Then the output should be Then the output should be
2013-07-23 09:00 Testing folder journal. 2013-07-23 09:00 Testing folder journal.

View file

@ -3,7 +3,7 @@ Feature: Starring entries
Scenario Outline: Starring an entry will mark it in the journal file Scenario Outline: Starring an entry will mark it in the journal file
Given we use the config "<config_file>" Given we use the config "<config_file>"
When we run "jrnl 20 july 2013 *: Best day of my life!" When we run "jrnl 20 july 2013 *: Best day of my life!"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -on 2013-07-20 -starred" When we run "jrnl -on 2013-07-20 -starred"
Then the output should contain "2013-07-20 09:00 Best day of my life!" Then the output should contain "2013-07-20 09:00 Best day of my life!"
@ -30,6 +30,6 @@ Feature: Starring entries
Scenario: Starring an entry will mark it in an encrypted journal Scenario: Starring an entry will mark it in an encrypted journal
Given we use the config "encrypted.yaml" Given we use the config "encrypted.yaml"
When we run "jrnl 20 july 2013 *: Best day of my life!" and enter "bad doggie no biscuit" When we run "jrnl 20 july 2013 *: Best day of my life!" and enter "bad doggie no biscuit"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -on 2013-07-20 -starred" and enter "bad doggie no biscuit" When we run "jrnl -on 2013-07-20 -starred" and enter "bad doggie no biscuit"
Then the output should contain "2013-07-20 09:00 Best day of my life!" Then the output should contain "2013-07-20 09:00 Best day of my life!"

View file

@ -46,7 +46,7 @@ Feature: Writing new entries.
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 "bad doggie no biscuit" if prompted
When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa." When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should contain "2013-07-23 09:00 A cold and stormy day." Then the output should contain "2013-07-23 09:00 A cold and stormy day."
@ -61,7 +61,7 @@ Feature: Writing new entries.
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 run "jrnl this is a partial --edit" When we run "jrnl this is a partial --edit"
Then we should see the message "Entry added" Then the output should contain "Entry added"
Then the editor should have been called Then the editor should have been called
And the editor file content should be And the editor file content should be
this is a partial this is a partial
@ -110,7 +110,7 @@ Feature: Writing new entries.
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 "bad doggie no biscuit" if prompted
When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa." When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should not contain "Life is good" Then the output should not contain "Life is good"
@ -125,7 +125,7 @@ Feature: Writing new entries.
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 "bad doggie no biscuit" if prompted
When we run "jrnl 04-24-2014: Created a new website - empty.com. Hope to get a lot of traffic." When we run "jrnl 04-24-2014: Created a new website - empty.com. Hope to get a lot of traffic."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -1" When we run "jrnl -1"
Then the output should be Then the output should be
2014-04-24 09:00 Created a new website - empty.com. 2014-04-24 09:00 Created a new website - empty.com.
@ -142,7 +142,7 @@ Feature: Writing new entries.
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 "bad doggie no biscuit" if prompted
When we run "jrnl 23 july 2013: 🌞 sunny day. Saw an 🐘" When we run "jrnl 23 july 2013: 🌞 sunny day. Saw an 🐘"
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -n 1" When we run "jrnl -n 1"
Then the output should contain "🌞" Then the output should contain "🌞"
And the output should contain "🐘" And the output should contain "🐘"
@ -199,7 +199,7 @@ Feature: Writing new entries.
Scenario: Title with an embedded period on DayOne journal Scenario: Title with an embedded period on DayOne journal
Given we use the config "dayone.yaml" Given we use the config "dayone.yaml"
When we run "jrnl 04-24-2014: Ran 6.2 miles today in 1:02:03. I am feeling sore because I forgot to stretch." When we run "jrnl 04-24-2014: Ran 6.2 miles today in 1:02:03. I am feeling sore because I forgot to stretch."
Then we should see the message "Entry added" Then the output should contain "Entry added"
When we run "jrnl -1" When we run "jrnl -1"
Then the output should be Then the output should be
2014-04-24 09:00 Ran 6.2 miles today in 1:02:03. 2014-04-24 09:00 Ran 6.2 miles today in 1:02:03.
@ -208,6 +208,6 @@ Feature: Writing new entries.
Scenario: Opening an folder that's not a DayOne folder should treat as folder journal Scenario: Opening an folder that's not a DayOne folder should treat as folder journal
Given we use the config "empty_folder.yaml" Given we use the config "empty_folder.yaml"
When we run "jrnl 23 july 2013: Testing folder journal." When we run "jrnl 23 july 2013: Testing folder journal."
Then we should see the message "Entry added" Then the output should contain "Entry added"
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."

View file

@ -90,12 +90,6 @@ def output_should_be_columns_wide(cli_run, width):
assert len(line) <= width assert len(line) <= width
@then(parse('we should see the message "{text}"'))
def should_see_the_message(text, cli_run):
out = cli_run["stderr"]
assert text in out, [text, out]
@then( @then(
parse( parse(
'the config for journal "{journal_name}" {should_or_should_not} contain "{some_yaml}"' 'the config for journal "{journal_name}" {should_or_should_not} contain "{some_yaml}"'