diff --git a/tests/test_patch.py b/tests/test_patch.py index 872e3b6..0a3e333 100644 --- a/tests/test_patch.py +++ b/tests/test_patch.py @@ -21,6 +21,7 @@ # SOFTWARE. import os +import stat import shutil from kas import kas @@ -33,3 +34,5 @@ def test_patch(tmpdir): shutil.copytree('tests/test_patch', tdir) os.chdir(tdir) kas.kas(['shell', 'test.yml', '-c', 'true']) + for f in ['kas/tests/test_patch/hello.sh', 'hello/hello.sh']: + assert os.stat(f)[stat.ST_MODE] & stat.S_IXUSR diff --git a/tests/test_patch/patches/hello/quilt/003.patch b/tests/test_patch/patches/hello/quilt/003.patch new file mode 100644 index 0000000..ee27e89 --- /dev/null +++ b/tests/test_patch/patches/hello/quilt/003.patch @@ -0,0 +1,15 @@ +# HG changeset patch +# User kas +# Date 1568977454 -7200 +# Fri Sep 20 13:04:14 2019 +0200 +# Node ID b8fc0927f880cc0ef6b79ba6ee470f7504d68466 +# Parent 66ff34c19e817cf518ebbd53bef4a992d669e68e +msg + +diff --git a/hello.sh b/hello.sh +new file mode 100755 +--- /dev/null ++++ b/hello.sh +@@ -0,0 +1,2 @@ ++#!/bin/sh ++echo Hello World! diff --git a/tests/test_patch/patches/hello/quilt/series b/tests/test_patch/patches/hello/quilt/series index 7ecf098..a3d18c1 100644 --- a/tests/test_patch/patches/hello/quilt/series +++ b/tests/test_patch/patches/hello/quilt/series @@ -2,3 +2,4 @@ # this is a revert of the other 001 we applied without quilt 001.patch # first patch 002.patch +003.patch # introduce an executable diff --git a/tests/test_patch/patches/kas/quilt/003.patch b/tests/test_patch/patches/kas/quilt/003.patch new file mode 100644 index 0000000..848ed0c --- /dev/null +++ b/tests/test_patch/patches/kas/quilt/003.patch @@ -0,0 +1,21 @@ +From b401ea2143d6e214a74f100c1d86b57ee3aaed26 Mon Sep 17 00:00:00 2001 +From: kas +Date: Fri, 20 Sep 2019 10:33:07 +0200 +Subject: [PATCH] test + +--- + tests/test_patch/hello.sh | 2 ++ + 1 file changed, 2 insertions(+) + create mode 100755 tests/test_patch/hello.sh + +diff --git a/tests/test_patch/hello.sh b/tests/test_patch/hello.sh +new file mode 100755 +index 0000000..c100654 +--- /dev/null ++++ b/tests/test_patch/hello.sh +@@ -0,0 +1,2 @@ ++#!/bin/sh ++echo Hello World! +-- +2.21.0 + diff --git a/tests/test_patch/patches/kas/quilt/series b/tests/test_patch/patches/kas/quilt/series index 7ecf098..a3d18c1 100644 --- a/tests/test_patch/patches/kas/quilt/series +++ b/tests/test_patch/patches/kas/quilt/series @@ -2,3 +2,4 @@ # this is a revert of the other 001 we applied without quilt 001.patch # first patch 002.patch +003.patch # introduce an executable