aurweb/test/t2400-aurblup.t
Kevin Morris e800cefe95 Makefile: run pytest units
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>
2021-06-05 19:49:19 -07:00

53 lines
876 B
Bash
Executable file

#!/bin/sh
test_description='aurblup tests'
. "$(dirname "$0")/setup.sh"
test_expect_success 'Test official provider update script.' '
mkdir -p remote/test/foobar-1.0-1 &&
cat <<-EOD >remote/test/foobar-1.0-1/desc &&
%FILENAME%
foobar-1.0-any.pkg.tar.xz
%NAME%
foobar
%VERSION%
1.0-1
%ARCH%
any
EOD
mkdir -p remote/test/foobar2-1.0-1 &&
cat <<-EOD >remote/test/foobar2-1.0-1/desc &&
%FILENAME%
foobar2-1.0-any.pkg.tar.xz
%NAME%
foobar2
%VERSION%
1.0-1
%ARCH%
any
%PROVIDES%
foobar3
foobar4
EOD
( cd remote/test && bsdtar -czf ../test.db * ) &&
mkdir sync &&
cover "$AURBLUP" &&
cat <<-EOD >expected &&
foobar|test|foobar
foobar2|test|foobar2
foobar2|test|foobar3
foobar2|test|foobar4
EOD
echo "SELECT Name, Repo, Provides FROM OfficialProviders ORDER BY Provides;" | sqlite3 aur.db >actual &&
test_cmp actual expected
'
test_done