-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adjust the wizard resume message for known compatibility
- Loading branch information
Showing
3 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -1881,11 +1881,28 @@ def test_control_c_save_progress(self): | |
changed_version = tmpdir / "changed-version" | ||
with open(changed_version, "w", encoding="utf8") as f: | ||
f.write(progress_lines[0]) | ||
f.write(progress_lines[1].replace("\n", "changed\n")) | ||
incremented_version = progress_lines[1][:-2] + str( | ||
int(progress_lines[1][-2:-1]) + 1 | ||
) | ||
f.write(incremented_version + "\n") | ||
f.write("".join(progress_lines[2:])) | ||
tour = make_trivial_tour() | ||
with patch_input("[email protected]"), capture_stdout() as out: | ||
tour.run(resume_from=changed_version) | ||
self.assertRegex(out.getvalue(), r"(?s)expected.*to.*be.*compatible") | ||
self.assertRegex(out.getvalue(), r"(?s)Proceeding.*anyway") | ||
self.assertIn("Applying saved response", out.getvalue()) | ||
self.assertEqual(tour.state, self.trivial_tour_results) | ||
|
||
# resume from a potentially incompatible older version | ||
with open(changed_version, "w", encoding="utf8") as f: | ||
f.write(progress_lines[0]) | ||
f.write(" - 0.1.2\n") | ||
f.write("".join(progress_lines[2:])) | ||
tour = make_trivial_tour() | ||
with patch_input("[email protected]"), capture_stdout() as out: | ||
tour.run(resume_from=changed_version) | ||
self.assertRegex(out.getvalue(), r"(?s)not.*fully.*compatible") | ||
self.assertRegex(out.getvalue(), r"(?s)Proceeding.*anyway") | ||
self.assertIn("Applying saved response", out.getvalue()) | ||
self.assertEqual(tour.state, self.trivial_tour_results) | ||
|
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
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