Unit Tests
- Corrected expected output from the on-modify-misbehave4 test hook script. - Moved JSON syntax error details to debug output.
This commit is contained in:
@@ -441,7 +441,8 @@ void Hooks::assertValidJSON (const std::vector <std::string>& input) const
|
|||||||
catch (const std::string& e)
|
catch (const std::string& e)
|
||||||
{
|
{
|
||||||
context.error ("Hook Error: JSON syntax error in: " + *i);
|
context.error ("Hook Error: JSON syntax error in: " + *i);
|
||||||
context.error ("Hook Error: JSON " + e);
|
if (_debug)
|
||||||
|
context.error ("Hook Error: JSON " + e);
|
||||||
throw 0;
|
throw 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class TestHooksOnModify(TestCase):
|
|||||||
|
|
||||||
code, out, err = self.t(("add", "foo"))
|
code, out, err = self.t(("add", "foo"))
|
||||||
code, out, err = self.t.runError(("1", "modify", "+tag"))
|
code, out, err = self.t.runError(("1", "modify", "+tag"))
|
||||||
self.assertIn("ERROR SYNTACTICALLY WRONG JSON", err)
|
self.assertIn("Hook Error: JSON syntax error in: {\"}", err)
|
||||||
self.t.hooks[hookname].assertTriggered()
|
self.t.hooks[hookname].assertTriggered()
|
||||||
self.t.hooks[hookname].assertTriggeredCount(1)
|
self.t.hooks[hookname].assertTriggeredCount(1)
|
||||||
self.t.hooks[hookname].assertExitcode(0)
|
self.t.hooks[hookname].assertExitcode(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user