-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jordan Heffernan
committed
Mar 26, 2024
1 parent
05917c8
commit 478519d
Showing
4 changed files
with
33 additions
and
38 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,22 @@ | ||
# Test to ensure pre-exisiting hooks within the .pre-commit-config.yaml files | ||
# are persisted when installing secureli | ||
|
||
MOCK_REPO='tests/test-data/mock-repo' | ||
|
||
setup() { | ||
load "${BATS_LIBS_ROOT}/bats-support/load" | ||
load "${BATS_LIBS_ROOT}/bats-assert/load" | ||
mkdir -p $MOCK_REPO | ||
echo 'print("hello world!")' > $MOCK_REPO/hw.py | ||
run git init $MOCK_REPO | ||
} | ||
|
||
@test "can preserve pre-existing hooks" { | ||
run python secureli/main.py init -y --directory $MOCK_REPO | ||
run grep 'https://github.com/psf/black' $MOCK_REPO/.secureli/.pre-commit-config.yaml | ||
assert_output --partial 'https://github.com/psf/black' | ||
} | ||
|
||
teardown() { | ||
rm -rf $MOCK_REPO | ||
} |