| OLD | NEW |
| 1 # vim: set fileencoding=utf-8 : | 1 # vim: set fileencoding=utf-8 : |
| 2 # Copyright (C) 2010 Google Inc. All rights reserved. | 2 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 # NOTE: The fileencoding comment on the first line of the file is | 30 # NOTE: The fileencoding comment on the first line of the file is |
| 31 # important; without it, Python will choke while trying to parse the file, | 31 # important; without it, Python will choke while trying to parse the file, |
| 32 # since it includes non-ASCII characters. | 32 # since it includes non-ASCII characters. |
| 33 | 33 |
| 34 import os | 34 import os |
| 35 import stat | 35 import stat |
| 36 import sys | 36 import sys |
| 37 import tempfile | 37 import tempfile |
| 38 import webkitpy.thirdparty.unittest2 as unittest | 38 import unittest |
| 39 | 39 |
| 40 from webkitpy.common.system.filesystem import FileSystem | 40 from webkitpy.common.system.filesystem import FileSystem |
| 41 | 41 |
| 42 | 42 |
| 43 class GenericFileSystemTests(object): | 43 class GenericFileSystemTests(object): |
| 44 """Tests that should pass on either a real or mock filesystem.""" | 44 """Tests that should pass on either a real or mock filesystem.""" |
| 45 # pylint gets confused about this being a mixin: pylint: disable=E1101 | 45 # pylint gets confused about this being a mixin: pylint: disable=E1101 |
| 46 def setup_generic_test_dir(self): | 46 def setup_generic_test_dir(self): |
| 47 fs = self.fs | 47 fs = self.fs |
| 48 self.generic_test_dir = str(self.fs.mkdtemp()) | 48 self.generic_test_dir = str(self.fs.mkdtemp()) |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 fs = FileSystem() | 301 fs = FileSystem() |
| 302 self.assertTrue(fs.remove('filename', remove_with_exception)) | 302 self.assertTrue(fs.remove('filename', remove_with_exception)) |
| 303 self.assertEqual(-1, RealFileSystemTest._remove_failures) | 303 self.assertEqual(-1, RealFileSystemTest._remove_failures) |
| 304 | 304 |
| 305 def test_sep(self): | 305 def test_sep(self): |
| 306 fs = FileSystem() | 306 fs = FileSystem() |
| 307 | 307 |
| 308 self.assertEqual(fs.sep, os.sep) | 308 self.assertEqual(fs.sep, os.sep) |
| 309 self.assertEqual(fs.join("foo", "bar"), | 309 self.assertEqual(fs.join("foo", "bar"), |
| 310 os.path.join("foo", "bar")) | 310 os.path.join("foo", "bar")) |
| OLD | NEW |