-
-
Notifications
You must be signed in to change notification settings - Fork 372
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 #1910 from freakboy3742/sign-order
Correct signing order for macOS bundles
- Loading branch information
Showing
7 changed files
with
252 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The order in which nested frameworks and apps are signed on macOS was corrected. |
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,75 @@ | ||
import pytest | ||
|
||
from briefcase.integrations.file import File | ||
|
||
from ...utils import create_file | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"files, sorted", | ||
[ | ||
# Files in a directory are sorted lexically | ||
( | ||
["foo/bar/a.txt", "foo/bar/c.txt", "foo/bar/b.txt"], | ||
["foo/bar/c.txt", "foo/bar/b.txt", "foo/bar/a.txt"], | ||
), | ||
# Subfolders are sorted before files in that directory; but sorted lexically in themselves | ||
( | ||
[ | ||
"foo/bar/b", | ||
"foo/bar/b/aaa.txt", | ||
"foo/bar/b/zzz.txt", | ||
"foo/bar/b/deeper", | ||
"foo/bar/b/deeper/deeper_db2.txt", | ||
"foo/bar/b/deeper/deeper_db1.txt", | ||
"foo/bar/a.txt", | ||
"foo/bar/c.txt", | ||
"foo/bar/e.txt", | ||
"foo/bar/d", | ||
"foo/bar/d/deep_d2.txt", | ||
"foo/bar/d/deep_d1.txt", | ||
], | ||
[ | ||
"foo/bar/d/deep_d2.txt", | ||
"foo/bar/d/deep_d1.txt", | ||
"foo/bar/b/deeper/deeper_db2.txt", | ||
"foo/bar/b/deeper/deeper_db1.txt", | ||
"foo/bar/b/deeper", | ||
"foo/bar/b/zzz.txt", | ||
"foo/bar/b/aaa.txt", | ||
"foo/bar/d", | ||
"foo/bar/b", | ||
"foo/bar/e.txt", | ||
"foo/bar/c.txt", | ||
"foo/bar/a.txt", | ||
], | ||
), | ||
# If a folder contains both folders and files, the folders are returned first. | ||
( | ||
[ | ||
"foo/bar/a", | ||
"foo/bar/b.txt", | ||
"foo/bar/c", | ||
], | ||
[ | ||
"foo/bar/c", | ||
"foo/bar/a", | ||
"foo/bar/b.txt", | ||
], | ||
), | ||
], | ||
) | ||
def test_sorted_depth_first(files, sorted, tmp_path): | ||
# Convert the strings into paths in the temp folder | ||
paths = [tmp_path / file_path for file_path in files] | ||
|
||
# Create all the paths that have a suffix | ||
for file_path in paths: | ||
if file_path.suffix: | ||
create_file(tmp_path / file_path, content=str(file_path)) | ||
else: | ||
file_path.mkdir(parents=True, exist_ok=True) | ||
|
||
assert File.sorted_depth_first(paths) == [ | ||
tmp_path / file_path for file_path in sorted | ||
] |
78 changes: 78 additions & 0 deletions
78
tests/integrations/file/test_File__sorted_depth_first_groups.py
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,78 @@ | ||
import pytest | ||
|
||
from briefcase.integrations.file import File | ||
|
||
from ...utils import create_file | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"files, groups", | ||
[ | ||
# Files in a single directory are sorted lexically into the same group | ||
( | ||
["foo/bar/a.txt", "foo/bar/c.txt", "foo/bar/b.txt"], | ||
[ | ||
["foo/bar/c.txt", "foo/bar/b.txt", "foo/bar/a.txt"], | ||
], | ||
), | ||
# Subfolders are sorted before files in that directory, and in a different | ||
# group; but sorted lexically in themselves | ||
( | ||
[ | ||
"foo/bar/b", | ||
"foo/bar/b/aaa.txt", | ||
"foo/bar/b/zzz.txt", | ||
"foo/bar/b/deeper", | ||
"foo/bar/b/deeper/deeper_db2.txt", | ||
"foo/bar/b/deeper/deeper_db1.txt", | ||
"foo/bar/a.txt", | ||
"foo/bar/c.txt", | ||
"foo/bar/e.txt", | ||
"foo/bar/d", | ||
"foo/bar/d/deep_d2.txt", | ||
"foo/bar/d/deep_d1.txt", | ||
], | ||
[ | ||
["foo/bar/d/deep_d2.txt", "foo/bar/d/deep_d1.txt"], | ||
["foo/bar/b/deeper/deeper_db2.txt", "foo/bar/b/deeper/deeper_db1.txt"], | ||
["foo/bar/b/deeper"], | ||
["foo/bar/b/zzz.txt", "foo/bar/b/aaa.txt"], | ||
["foo/bar/d", "foo/bar/b"], | ||
["foo/bar/e.txt", "foo/bar/c.txt", "foo/bar/a.txt"], | ||
], | ||
), | ||
# If a folder contains both folders and files, the folders are in a different | ||
# group the files, and are returned first. | ||
( | ||
[ | ||
"foo/bar/a", | ||
"foo/bar/b.txt", | ||
"foo/bar/c", | ||
], | ||
[ | ||
[ | ||
"foo/bar/c", | ||
"foo/bar/a", | ||
], | ||
[ | ||
"foo/bar/b.txt", | ||
], | ||
], | ||
), | ||
], | ||
) | ||
def test_sorted_depth_first_groups(files, groups, tmp_path): | ||
# Convert the strings into paths in the temp folder | ||
paths = [tmp_path / file_path for file_path in files] | ||
|
||
# Create files for all paths that have a suffix; otherwise, ensure the folder | ||
# exists. | ||
for file_path in paths: | ||
if file_path.suffix: | ||
create_file(tmp_path / file_path, content=str(file_path)) | ||
else: | ||
file_path.mkdir(parents=True, exist_ok=True) | ||
|
||
assert list(list(group) for group in File.sorted_depth_first_groups(paths)) == [ | ||
[tmp_path / file_path for file_path in group] for group in groups | ||
] |
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