-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into git-coverage
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
import os | ||
|
||
from datetime import date | ||
from pathlib import Path | ||
from subprocess import call | ||
from textwrap import dedent | ||
|
@@ -303,6 +304,33 @@ def run_order_scenario(sections, types): | |
), | ||
) | ||
|
||
def test_draft_no_date(self): | ||
""" | ||
If no date is passed, today's date is used. | ||
""" | ||
runner = CliRunner() | ||
|
||
with runner.isolated_filesystem(): | ||
setup_simple_project() | ||
fragment_path1 = "foo/newsfragments/123.feature" | ||
fragment_path2 = "foo/newsfragments/124.feature.rst" | ||
with open(fragment_path1, "w") as f: | ||
f.write("Adds levitation") | ||
with open(fragment_path2, "w") as f: | ||
f.write("Extends levitation") | ||
|
||
call(["git", "init"]) | ||
call(["git", "config", "user.name", "user"]) | ||
call(["git", "config", "user.email", "[email protected]"]) | ||
call(["git", "add", "."]) | ||
call(["git", "commit", "-m", "Initial Commit"]) | ||
|
||
today = date.today() | ||
result = runner.invoke(_main, ["--draft"]) | ||
|
||
self.assertEqual(0, result.exit_code) | ||
self.assertIn(f"Foo 1.2.3 ({today.isoformat()})", result.output) | ||
|
||
def test_no_confirmation(self): | ||
runner = CliRunner() | ||
|
||
|