diff options
author | Josh Blum | 2013-03-17 17:47:28 -0700 |
---|---|---|
committer | Josh Blum | 2013-03-17 17:47:28 -0700 |
commit | 2d300490f74492f39be660979b5b1ccdbd59a7e4 (patch) | |
tree | c2a89794d7310ce53b33823bde78f80dc7dfcc87 /tests | |
parent | 468d53f7797c63cda2ef9ba765f1066550d19ce4 (diff) | |
download | sandhi-2d300490f74492f39be660979b5b1ccdbd59a7e4.tar.gz sandhi-2d300490f74492f39be660979b5b1ccdbd59a7e4.tar.bz2 sandhi-2d300490f74492f39be660979b5b1ccdbd59a7e4.zip |
gras: tweaks to the python unit test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/block_props_test.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/block_props_test.py b/tests/block_props_test.py index 6c502a3..9458860 100644 --- a/tests/block_props_test.py +++ b/tests/block_props_test.py @@ -16,6 +16,8 @@ class MyBlock(gras.Block): return self.foo def set_foo(self, new_foo): + print "new_foo", new_foo + new_foo + 0 #throws if its not a number self.foo = new_foo class BlockPropsTest(unittest.TestCase): @@ -36,18 +38,14 @@ class BlockPropsTest(unittest.TestCase): #property does not exist threw = False try: my_block.get("bar") - except Exception as ex: - print ex - threw = True - self.assertFalse(threw) + except: threw = True + self.assertTrue(threw) #wrong type for property threw = False - try: my_block.set("foo", float(42)) - except Exception as ex: - print ex - threw = True - self.assertFalse(threw) + try: my_block.set("foo", None) + except: threw = True + self.assertTrue(threw) if __name__ == '__main__': unittest.main() |