mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add tests for the restore command
Test the restore mode of git-serve and git-update. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
dd9c6f3ddc
commit
83df9808b4
2 changed files with 46 additions and 0 deletions
|
@ -85,4 +85,21 @@ test_expect_success "Try to push to someone else's repository as Trusted User."
|
|||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success "Test restore." '
|
||||
echo "DELETE FROM PackageBases WHERE Name = \"foobar\";" | \
|
||||
sqlite3 aur.db &&
|
||||
cat >expected <<-EOF &&
|
||||
user
|
||||
foobar
|
||||
EOF
|
||||
SSH_ORIGINAL_COMMAND="restore foobar" AUR_USER=user AUR_PRIVILEGED=0 \
|
||||
"$GIT_SERVE" 2>&1 >actual
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success "Try to restore an existing package base." '
|
||||
SSH_ORIGINAL_COMMAND="restore foobar2" AUR_USER=user AUR_PRIVILEGED=0 \
|
||||
test_must_fail "$GIT_SERVE" 2>&1
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue