diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2011-06-29 15:22:56 -0700 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2011-06-29 15:22:56 -0700 |
| commit | 7555aca28a5ab1ba4dd1be04a91bf6347eaac84f (patch) | |
| tree | f21bb20974027103bd694e2ebb4d4ec425914047 /nova/tests | |
| parent | 097e25f69a3ce4fe29addf93e4f92fa861aa54dc (diff) | |
fix issue of recurse_zones not being converted to bool properly
add bool_from_str util call
add test for bool_from_str
slight rework of min/max_count check
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py index 3a3f914e4..0c359e981 100644 --- a/nova/tests/test_utils.py +++ b/nova/tests/test_utils.py @@ -276,6 +276,19 @@ class GenericUtilsTestCase(test.TestCase): result = utils.parse_server_string('www.exa:mple.com:8443') self.assertEqual(('', ''), result) + def test_bool_from_str(self): + self.assertTrue(utils.bool_from_str('1')) + self.assertTrue(utils.bool_from_str('2')) + self.assertTrue(utils.bool_from_str('-1')) + self.assertTrue(utils.bool_from_str('true')) + self.assertTrue(utils.bool_from_str('True')) + self.assertTrue(utils.bool_from_str('tRuE')) + self.assertFalse(utils.bool_from_str('False')) + self.assertFalse(utils.bool_from_str('false')) + self.assertFalse(utils.bool_from_str('0')) + self.assertFalse(utils.bool_from_str(None)) + self.assertFalse(utils.bool_from_str('junk')) + class IsUUIDLikeTestCase(test.TestCase): def assertUUIDLike(self, val, expected): |
