Revision a426508d test/ganeti.utils_unittest.py
b/test/ganeti.utils_unittest.py | ||
---|---|---|
295 | 295 |
def testSimpleRename1(self): |
296 | 296 |
"""Simple rename 1""" |
297 | 297 |
utils.RenameFile(self.tmpfile, os.path.join(self.tmpdir, "xyz")) |
298 |
self.assert_(os.path.isfile(os.path.join(self.tmpdir, "xyz"))) |
|
298 | 299 |
|
299 | 300 |
def testSimpleRename2(self): |
300 | 301 |
"""Simple rename 2""" |
301 | 302 |
utils.RenameFile(self.tmpfile, os.path.join(self.tmpdir, "xyz"), |
302 | 303 |
mkdir=True) |
304 |
self.assert_(os.path.isfile(os.path.join(self.tmpdir, "xyz"))) |
|
303 | 305 |
|
304 | 306 |
def testRenameMkdir(self): |
305 | 307 |
"""Rename with mkdir""" |
306 | 308 |
utils.RenameFile(self.tmpfile, os.path.join(self.tmpdir, "test/xyz"), |
307 | 309 |
mkdir=True) |
310 |
self.assert_(os.path.isdir(os.path.join(self.tmpdir, "test"))) |
|
311 |
self.assert_(os.path.isfile(os.path.join(self.tmpdir, "test/xyz"))) |
|
312 |
|
|
313 |
utils.RenameFile(os.path.join(self.tmpdir, "test/xyz"), |
|
314 |
os.path.join(self.tmpdir, "test/foo/bar/baz"), |
|
315 |
mkdir=True) |
|
316 |
self.assert_(os.path.isdir(os.path.join(self.tmpdir, "test"))) |
|
317 |
self.assert_(os.path.isdir(os.path.join(self.tmpdir, "test/foo/bar"))) |
|
318 |
self.assert_(os.path.isfile(os.path.join(self.tmpdir, "test/foo/bar/baz"))) |
|
308 | 319 |
|
309 | 320 |
|
310 | 321 |
class TestMatchNameComponent(unittest.TestCase): |
Also available in: Unified diff