[PATCH] Update test_stb_invalid to handle Exception

James Laska jlaska at redhat.com
Tue Dec 13 16:20:25 UTC 2011


---
 tests/ozutil/test_ozutil.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/ozutil/test_ozutil.py b/tests/ozutil/test_ozutil.py
index 93f5a08..71c73ea 100644
--- a/tests/ozutil/test_ozutil.py
+++ b/tests/ozutil/test_ozutil.py
@@ -186,8 +186,8 @@ def test_stb_none():
 
 
 def test_stb_invalid():
-    if oz.ozutil.string_to_bool('foobar') != None:
-        raise Exception, "Expected None return from string_to_bool"
+    with py.test.raises(Exception):
+        oz.ozutil.string_to_bool('foobar')
 
 # test oz.ozutil.generate_macaddress
 def test_genmac():
-- 
1.7.7.4




More information about the aeolus-devel mailing list