diff options
Diffstat (limited to 'Tools/Scripts/webkitpy/common/system/filesystem_unittest.py')
-rw-r--r-- | Tools/Scripts/webkitpy/common/system/filesystem_unittest.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py b/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py index 8455d72..8d4f0cb 100644 --- a/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py +++ b/Tools/Scripts/webkitpy/common/system/filesystem_unittest.py @@ -48,6 +48,23 @@ class FileSystemTest(unittest.TestCase): self._missing_file = os.path.join(self._this_dir, 'missing_file.py') self._this_file = os.path.join(self._this_dir, 'filesystem_unittest.py') + def test_chdir(self): + fs = FileSystem() + cwd = fs.getcwd() + newdir = '/' + if sys.platform == 'win32': + newdir = 'c:\\' + fs.chdir(newdir) + self.assertEquals(fs.getcwd(), newdir) + fs.chdir(cwd) + + def test_chdir__notexists(self): + fs = FileSystem() + newdir = '/dirdoesnotexist' + if sys.platform == 'win32': + newdir = 'c:\\dirdoesnotexist' + self.assertRaises(OSError, fs.chdir, newdir) + def test_exists__true(self): fs = FileSystem() self.assertTrue(fs.exists(self._this_file)) @@ -56,6 +73,10 @@ class FileSystemTest(unittest.TestCase): fs = FileSystem() self.assertFalse(fs.exists(self._missing_file)) + def test_getcwd(self): + fs = FileSystem() + self.assertTrue(fs.exists(fs.getcwd())) + def test_isdir__true(self): fs = FileSystem() self.assertTrue(fs.isdir(self._this_dir)) |