summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests/sourceonlypolicy38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/tests/sourceonlypolicy b/tests/tests/sourceonlypolicy
new file mode 100755
index 0000000..b0569c3
--- /dev/null
+++ b/tests/tests/sourceonlypolicy
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-tstunt-parsechangelog
+
+t-prep-newpackage example 1.0
+
+cd $p
+revision=1
+
+dgit-with-policy () {
+ local policy=$1; shift
+ t-dgit -cdgit-distro.test-dummy.source-only-uploads=$policy "$@"
+}
+
+t-expect-fail E:'source-only.*entirely NEW' \
+dgit-with-policy not-wholly-new push-source --new
+
+t-expect-fail E:'source-only.*requires \.debs' \
+dgit-with-policy never push-source --new
+
+dgit-with-policy always push-source --new
+
+t-archive-process-incoming sid
+
+t-commit 'Now with binaries'
+
+t-dgit -wgf build
+
+t-expect-fail E:'uploading binaries.*source only' \
+dgit-with-policy always push --new
+
+t-commit 'Source-only not NEW'
+
+dgit-with-policy not-wholly-new push-source --new
+
+t-ok