mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Important note: Python tests will repeatedly clear out tables that they test against; for this reason, one should always run the shell tests first. The __init__.py file is necessary for coverage to collect data from the tests being run. At this point in FastAPI development, I'd like to encourage a few things going forward: 1. Any time you contribute to the FastAPI codebase, you **must** maintain equal or increased coverage on the overall source. Developers are highly appreciated for adding tests in your specific domain of addition or modification that may be missing coverage. Our goal is 100% coverage, and all newly added files **must** have 100% coverage through tests. 2. All source should be formatted with the autopep8 tool and kept within an 80 column width, with the exception of HTML templates. Signed-off-by: Kevin Morris <kevr@0cost.org>
26 lines
970 B
Bash
Executable file
26 lines
970 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='pkgmaint tests'
|
|
|
|
. "$(dirname "$0")/setup.sh"
|
|
|
|
test_expect_success 'Test package base cleanup script.' '
|
|
now=$(date -d now +%s) &&
|
|
threedaysago=$(date -d "3 days ago" +%s) &&
|
|
cat <<-EOD | sqlite3 aur.db &&
|
|
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (1, "foobar", 1, $now, 0, "");
|
|
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (2, "foobar2", 2, $threedaysago, 0, "");
|
|
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (3, "foobar3", NULL, $now, 0, "");
|
|
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (4, "foobar4", NULL, $threedaysago, 0, "");
|
|
EOD
|
|
cover "$PKGMAINT" &&
|
|
cat <<-EOD >expected &&
|
|
foobar
|
|
foobar2
|
|
foobar3
|
|
EOD
|
|
echo "SELECT Name FROM PackageBases;" | sqlite3 aur.db >actual &&
|
|
test_cmp actual expected
|
|
'
|
|
|
|
test_done
|