From ff83a8987cae6aba71e4b912d6f3dd7a390fc1c3 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Wed, 9 Dec 2015 16:52:17 +0000 Subject: Add tests for 'ignore' and 'globs' validation * Does not explicitely test 'globs' validation. * Also verifies a missing 'ignore' field does not result in error. Change-Id: I8140185a485cccdf7086533d3afcc6b7fc5f121b --- yarns.webapp/060-validation.yarn | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'yarns.webapp/060-validation.yarn') diff --git a/yarns.webapp/060-validation.yarn b/yarns.webapp/060-validation.yarn index 040f6cd..076879b 100644 --- a/yarns.webapp/060-validation.yarn +++ b/yarns.webapp/060-validation.yarn @@ -97,6 +97,30 @@ not have a reasonable way to get the Trove ID of the local Trove, so we're skipping implementing that test for now. (FIXME: fix this lack of testing.) +The `ignore` field in a `trove` section and the `globs` field in a +`lorry` section are expected to be lists of strings, test a non-list +value. + + GIVEN an empty lorry-controller.conf in CONFGIT + AND lorry-controller.conf in CONFGIT adds trove example-trove + AND lorry-controller.conf in CONFGIT sets ignore to "foo" for trove example-trove + WHEN admin makes request POST /1.0/read-configuration + THEN response matches "ERROR" + AND STATEDB is empty + +And a non-string list. + + GIVEN lorry-controller.conf in CONFGIT sets ignore to "[1, 2]" for trove example-trove + WHEN admin makes request POST /1.0/read-configuration + THEN response matches "ERROR" + AND STATEDB is empty + +`ignore` is is not a mandatory option, verify this is the case. + + GIVEN lorry-controller.conf in CONFGIT removes field ignore from trove example-trove + WHEN admin makes request POST /1.0/read-configuration + THEN response matches "Configuration has been updated" + Clean up at the end. FINALLY WEBAPP terminates -- cgit v1.2.1