summaryrefslogtreecommitdiffstats
path: root/tests/commands/install_uninstall_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/commands/install_uninstall_test.py')
-rw-r--r--tests/commands/install_uninstall_test.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/commands/install_uninstall_test.py b/tests/commands/install_uninstall_test.py
index 314b8b9..3c07124 100644
--- a/tests/commands/install_uninstall_test.py
+++ b/tests/commands/install_uninstall_test.py
@@ -817,6 +817,35 @@ def test_post_merge_integration(tempdir_factory, store):
assert os.path.exists('post-merge.tmp')
+def test_post_rewrite_integration(tempdir_factory, store):
+ path = git_dir(tempdir_factory)
+ config = [
+ {
+ 'repo': 'local',
+ 'hooks': [{
+ 'id': 'post-rewrite',
+ 'name': 'Post rewrite',
+ 'entry': 'touch post-rewrite.tmp',
+ 'language': 'system',
+ 'always_run': True,
+ 'verbose': True,
+ 'stages': ['post-rewrite'],
+ }],
+ },
+ ]
+ write_config(path, config)
+ with cwd(path):
+ open('init', 'a').close()
+ cmd_output('git', 'add', '.')
+ install(C.CONFIG_FILE, store, hook_types=['post-rewrite'])
+ git_commit()
+
+ assert not os.path.exists('post-rewrite.tmp')
+
+ git_commit('--amend', '-m', 'ammended message')
+ assert os.path.exists('post-rewrite.tmp')
+
+
def test_post_checkout_integration(tempdir_factory, store):
path = git_dir(tempdir_factory)
config = [
@@ -948,7 +977,7 @@ def test_pre_merge_commit_integration(tempdir_factory, store):
output_pattern = re_assert.Matches(
r'^\[INFO\] Initializing environment for .+\n'
r'Bash hook\.+Passed\n'
- r"Merge made by the 'recursive' strategy.\n"
+ r"Merge made by the '(ort|recursive)' strategy.\n"
r' foo \| 0\n'
r' 1 file changed, 0 insertions\(\+\), 0 deletions\(-\)\n'
r' create mode 100644 foo\n$',