forked from OCA/oca-port
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OCA#65 from camptocamp/ref-mig-tips
MigrateAddon: rework generation of tips
- Loading branch information
Showing
4 changed files
with
100 additions
and
47 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
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from oca_port.migrate_addon import MigrateAddon | ||
|
||
from . import common | ||
|
||
|
||
class TestMigrateAddon(common.CommonCase): | ||
def test_usual_tips(self): | ||
app = self._create_app(self.source2, self.target2) | ||
mig = MigrateAddon(app) | ||
tips = mig._print_tips() | ||
self.assertIn("1) Reduce the number of commits", tips) | ||
self.assertIn("2) Adapt the module", tips) | ||
self.assertIn("3) On a shell command", tips) | ||
self.assertIn("4) Create the PR against", tips) | ||
self.assertNotIn("5) ", tips) | ||
|
||
def test_blacklist_tips(self): | ||
app = self._create_app(self.source2, self.target2) | ||
mig = MigrateAddon(app) | ||
tips = mig._print_tips(blacklisted=True) | ||
self.assertIn("1) On a shell command", tips) | ||
self.assertIn("2) Create the PR against", tips) | ||
self.assertNotIn("3) ", tips) | ||
|
||
def test_adapted_tips(self): | ||
app = self._create_app(self.source2, self.target2) | ||
mig = MigrateAddon(app) | ||
tips = mig._print_tips(adapted=True) | ||
self.assertIn("1) Reduce the number of commits", tips) | ||
self.assertIn("2) Adapt the module", tips) | ||
self.assertIn("3) Include your changes", tips) | ||
self.assertIn("4) Create the PR against", tips) | ||
self.assertNotIn("5) ", tips) |