~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/tests/test_utils.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import hashlib
20
20
import os
21
21
import os.path
22
 
import shutil
23
 
import socket
24
22
import StringIO
25
23
import tempfile
26
24
 
27
25
import eventlet
28
26
from eventlet import greenpool
29
 
import iso8601
30
27
import mox
31
28
 
32
29
import nova
332
329
        self.assertTrue(utils.bool_from_str('true'))
333
330
        self.assertTrue(utils.bool_from_str('True'))
334
331
        self.assertTrue(utils.bool_from_str('tRuE'))
 
332
        self.assertTrue(utils.bool_from_str('yes'))
 
333
        self.assertTrue(utils.bool_from_str('Yes'))
 
334
        self.assertTrue(utils.bool_from_str('YeS'))
 
335
        self.assertTrue(utils.bool_from_str('y'))
 
336
        self.assertTrue(utils.bool_from_str('Y'))
335
337
        self.assertFalse(utils.bool_from_str('False'))
336
338
        self.assertFalse(utils.bool_from_str('false'))
 
339
        self.assertFalse(utils.bool_from_str('no'))
 
340
        self.assertFalse(utils.bool_from_str('No'))
 
341
        self.assertFalse(utils.bool_from_str('n'))
 
342
        self.assertFalse(utils.bool_from_str('N'))
337
343
        self.assertFalse(utils.bool_from_str('0'))
338
344
        self.assertFalse(utils.bool_from_str(None))
339
345
        self.assertFalse(utils.bool_from_str('junk'))
756
762
        diff = utils.diff_dict(old, new)
757
763
 
758
764
        self.assertEqual(diff, dict(b=['-']))
 
765
 
 
766
 
 
767
class EnsureTree(test.TestCase):
 
768
    def test_ensure_tree(self):
 
769
        with utils.tempdir() as tmpdir:
 
770
            testdir = '%s/foo/bar/baz' % (tmpdir,)
 
771
            utils.ensure_tree(testdir)
 
772
            self.assertTrue(os.path.isdir(testdir))