From eaef8a05c238a91a97f1c0b1aa6628c0d949df85 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 18 Aug 2008 09:58:11 +0000 Subject: [PATCH] Copy qa_utils.AssertIn from 1.2 branch Apparently it was forgotten when import the remote API QA tests. Reviewed-by: schreiberal --- qa/qa_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qa/qa_utils.py b/qa/qa_utils.py index bbf667cc4..8ca367ed5 100644 --- a/qa/qa_utils.py +++ b/qa/qa_utils.py @@ -68,6 +68,14 @@ def _SetupColours(): _SetupColours() +def AssertIn(item, sequence): + """Raises an error when item is not in sequence. + + """ + if item not in sequence: + raise qa_error.Error('%r not in %r' % (item, sequence)) + + def AssertEqual(first, second): """Raises an error when values aren't equal. -- GitLab