projects
/
ganeti-local
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
074e139
)
QA: Add utility to ensure item is not in sequence
author
Michael Hanselmann
<hansmi@google.com>
Mon, 7 Mar 2011 18:59:24 +0000
(19:59 +0100)
committer
Michael Hanselmann
<hansmi@google.com>
Tue, 8 Mar 2011 10:55:21 +0000
(11:55 +0100)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
qa/qa_utils.py
patch
|
blob
|
history
diff --git
a/qa/qa_utils.py
b/qa/qa_utils.py
index
ce33e62
..
1beb77f
100644
(file)
--- a/
qa/qa_utils.py
+++ b/
qa/qa_utils.py
@@
-85,6
+85,14
@@
def AssertIn(item, sequence):
raise qa_error.Error('%r not in %r' % (item, sequence))
+def AssertNotIn(item, sequence):
+ """Raises an error when item is in sequence.
+
+ """
+ if item in sequence:
+ raise qa_error.Error('%r in %r' % (item, sequence))
+
+
def AssertEqual(first, second):
"""Raises an error when values aren't equal.